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

0 Members and 1 Guest are viewing this topic.

Peter2

  • Bull Frog
  • Posts: 435
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 2016 - 2018 German (so some technical terms will be badly retranslated to English)
Civil 3D 2017 - 2018

huiz

  • Swamp Rat
  • Posts: 769
  • 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

  • Bull Frog
  • Posts: 435
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 2016 - 2018 German (so some technical terms will be badly retranslated to English)
Civil 3D 2017 - 2018

Jeff_M

  • King Gator
  • Posts: 3891
  • 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: 6278
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 10 x64 - AutoCAD /C3D 2018

Custom Build PC

BIGAL

  • Newt
  • Posts: 69
  • 30 + 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

  • Bull Frog
  • Posts: 435
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 2016 - 2018 German (so some technical terms will be badly retranslated to English)
Civil 3D 2017 - 2018