Friday, July 17, 2009

AutoCAD Civil 3D ActiveX object model Part 3

In Parts 1 and 2 I introduced the concept of accessing the AutoCAD object model using Visual LISP. This is just a brief post on more of the resources and steps you need to use to customize Civil 3D.

In the Civil 3D Help folder, there is an extensive help file called civil_api_activex_reference.chm that documents the ActiveX model.

If you want to find out whether a feature line is added to a surface as a breakline, you can use something like this code in AutoCAD Civil 2010:


(vlax-dump-object
(vlax-safearray-get-element
(VLAX-variant-value
(vlax-get-property
(vlax-invoke
(vlax-get-property
(vlax-get-property
(vlax-get-property
(vlax-get-property
(vla-getinterfaceobject
(VLAX-GET-ACAD-OBJECT)
"AeccXUiLand.AeccApplication.7.0"
)
'ActiveDocument
)
'Surfaces
)
'Item
2
)
'Breaklines
)
'Item
0
)
'BreaklineEntities
)
)
2
)
T
)


The code above shows (dumps) the third (2) AutoCAD object in the first (0) breakline group in the third (2) surface of the active drawing. To find a particular AutoCAD object, you would have to loop through all the objects in all the Breaklines Sets in all the surfaces of the active drawing.

I believe, but I'm not sure, that to remove a single feature line from a surface, you would have to remove its entire breakline set, and then add again all the other feature lines in its set (which would bring up the issue of preserving original supplementing and mid-ordinate distances).

No comments:

Facebook Share