Author Topic: retrieve the names of Civil-surfaces from database  (Read 1714 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Swamp Rat
  • Posts: 650
retrieve the names of Civil-surfaces from database
« 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:

Code: [Select]
    (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))
    )

Code: [Select]
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?
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

huiz

  • Swamp Rat
  • Posts: 913
  • Certified Prof C3D
Re: retrieve the names of Civil-surfaces from database
« Reply #1 on: July 27, 2017, 07:33:58 AM »
Maybe you must specify if you want TinSurface, GridSurface, TinVolumeSurface or GridVolumeSurface objects.

Or it conflicts with the AutoCAD Surface object.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Peter2

  • Swamp Rat
  • Posts: 650
Re: retrieve the names of Civil-surfaces from database
« Reply #2 on: August 02, 2017, 12:18:54 PM »
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 ..
« Last Edit: August 04, 2017, 06:04:28 AM by Peter2 »
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: retrieve the names of Civil-surfaces from database
« Reply #3 on: August 02, 2017, 12:29:38 PM »
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.
« Last Edit: August 02, 2017, 01:13:36 PM by Jeff_M »

ronjonp

  • Needs a day job
  • Posts: 7526
Re: retrieve the names of Civil-surfaces from database
« Reply #4 on: August 02, 2017, 12:32:54 PM »
HERE's a thread that may help shed some light too.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

BIGAL

  • Swamp Rat
  • Posts: 1396
  • 40 + years of using Autocad
Re: retrieve the names of Civil-surfaces from database
« Reply #5 on: August 08, 2017, 07:09:03 AM »
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.
A man who never made a mistake never made anything

Peter2

  • Swamp Rat
  • Posts: 650
Re: retrieve the names of Civil-surfaces from database
« Reply #6 on: August 08, 2017, 09:01:44 AM »
Thanks BIGAL

I will take a look.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23