TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Peter2 on July 27, 2017, 07:30:24 AM
-
The following code works fine to get a list of Alignments and Profile-groups. But I tried to modify it for surfaces - and now I get a "type conflict", asking for ITEM:
(setq surfaces (vlax-get C3DDOC 'surfaces))
(setq surf_max (vlax-get-property surfaces "Count"))
(setq surf_counter 0)
(while (< surf_counter surf_max)
(setq surf_temp (vlax-invoke-method surfaces "Item" surf_counter))
(setq surf_counter (+ surf_counter 1))
)
Befehl: (setq ACADPROD (strcat "AeccXUiLand.AeccApplication." C3DVER))
"AeccXUiLand.AeccApplication.12.0"
Befehl: (setq *acad* (vlax-get-acad-object))
#<VLA-OBJECT IAcadApplication 00007ff73b0a5188>
Befehl: (setq C3DOBJECT (vla-getinterfaceobject *acad* ACADPROD))
#<VLA-OBJECT IAeccApplication 000001a6b32dbea0>
Befehl: (setq C3DDOC (vla-get-activedocument C3DOBJECT))
#<VLA-OBJECT IAeccDocument 000001a6b8b03c10>
Befehl: (setq surfaces (vlax-get C3DDOC 'surfaces))
#<VLA-OBJECT IAeccSurfaces 000001a69adfaca8>
Befehl: (setq surf_max (vlax-get-property surfaces "Count"))
2
Befehl: (setq surf_counter 0)
0
Befehl: (setq surf_temp (vlax-invoke-method surfaces "Item" surf_counter))
; Fehler: ActiveX-Server hat einen Fehler zurückgegeben: Typenkonflikt
I found some snippets to collect the surfaces, but they are using "SSGET" instead of "vlax-". What's wrong with it?
-
Maybe you must specify if you want TinSurface, GridSurface, TinVolumeSurface or GridVolumeSurface objects.
Or it conflicts with the AutoCAD Surface object.
-
I could solve it with a small lisp from here
http://cadtips.cadalyst.com/lisp-code-modules/detect-civil-3d-surfaces
But I don't know the background of the difference ..
-
Vlisp and C3D objects are quirky. I've found that using (vlax-for on the C3D collections will almost always work, whereas the Item method is a hit & miss.
-
HERE's (http://www.cadtutor.net/forum/showthread.php?101128-Finding-Local-Depressions-in-Surface&p=687329&viewfull=1#post687329) a thread that may help shed some light too.
-
I developed a routine whereby you can change the surfaces using a toolbar rather than toolspace, you can turn on/off etc as many as required. Its all in the ZIP there is a doc fileabout how to modify. So much easier than using toolspace. Its all done with lisp so open code.
-
Thanks BIGAL
I will take a look.