TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Peter2 on August 02, 2017, 12:40:29 PM
-
The question is 95% the same as here:
retrieve the names of Civil-surfaces from database
https://www.theswamp.org/index.php?topic=53271.0
It seems that the way to get the corridors (as object) is the third way (beside getting alignments and getting surfaces). So -
How to get the corridors (plus names) via Lisp?
Have a fine evening!
-
You need to use the RoadwayApplication...
(defun getRoadApp
(/ *acad
* C3D
) (if vlax
-user
-product
-key
(vlax-user-product-key)
)
)
C3D
(vl
-registry
-read C3D
"Release") C3D
1
"."
C3D
)
)
(strcat "AeccXUiRoadway.AeccRoadwayApplication." C3D
) )
)
)
C3D
)
)
(setq roadapp
(getRoadapp
) Roaddoc
(vlax-get roadapp 'activedocument
) corridors
(vlax-get Roaddoc 'Corridors
))
)
-
Great. Thanks a lot! :yay!:
Edit:
I browsed through this documents:
http://docs.autodesk.com/CIV3D/2018/ENU/API_Reference_Guide/html/e7b1fa34-671e-acd5-7f56-5f97d04c1494.htm
Am I too blind to find the information which Application (Roadway, Land, Pipe, ..) has to be used?
-
This is what I use to get the desired application:
(defun getaeccApp
(module
/ *acad
* C3D
) ;; module must be "Land", "Pipe", "Roadway", or "Survey" (if vlax
-user
-product
-key
(vlax-user-product-key)
)
)
C3D
(vl
-registry
-read C3D
"Release") C3D
1
"."
C3D
)
)
(strcat "AeccXUi" module
".Aecc" (if (= (strcase module
) "LAND") "" module
) "Application." C3D
) )
)
)
C3D
)
)
Corridors are in the Roadway application.