Sub Document_Example() ' This example creates a circle in model space and then ' finds the name of the document that the circle resides in. Dim circleObj As AcadCircle Dim dRadius As Double: dRadius = 5 Dim cntPnt(0 To 2) As Double cntPnt(0) = 2: cntPnt(1) = 2: cntPnt(2) = 0 Set circleObj = ThisDrawing.ModelSpace.AddCircle(cntPnt, dRadius) ThisDrawing.Application.ZoomExtents ' Find the document name for the circle Dim currDoc As AcadDocument Set currDoc = circleObj.Document MsgBox "The circle resides in: " & currDoc.Name End Sub
© Bricsys NV. All rights reserved. |