Author Topic: Civil 3D Structures and surfaces  (Read 2253 times)

0 Members and 1 Guest are viewing this topic.

jmcshane

  • Newt
  • Posts: 83
Civil 3D Structures and surfaces
« on: November 04, 2010, 02:29:07 PM »
Hi All,
For those of you out there who use Civil 3D, I am trying to assign a surface to all the structures in a pipe network.
Whenever I try and run the line highlighted in red I get an error: 
error: ActiveX Server returned an error: Type mismatch
I have a fair idea that someone is going to tell me the good news and inform me that its just not that simple,
so, my question is..........:
Is it possible to globally assign values to Civil 3D objects?
If it is possible, any chance of a hint?

Thanks in advance

John

Code: [Select]
(setq WorkingSurf (vlax-ename->vla-object (car (entsel "\nSelect Surface :"))))
(setq WorkingSurfaceName (vla-get-name WorkingSurf))
(if (> (setq SelectionSet (ssget "X" (list (cons 0  "AECC_STRUCTURE")))) Nil)
(progn
  (setq Objectctr 0)
(repeat (sslength SelectionSet)
(setq Item (ssname SelectionSet Objectctr))
(setq Item (vlax-ename->vla-object Item))
 
  [color=red](vlax-put-property Item 'Surface WorkingSurfaceName)[/color]

  (setq Objectctr (1+ Objectctr))
)
)
  )
John.

Civil 3D 2021. Windows 10

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Structures and surfaces
« Reply #1 on: November 04, 2010, 03:35:00 PM »
? ? ?

Code: [Select]
(vlax-property-available-p item 'surface T)

Edit: I do not have your software version, so I don't have the help file to look it up myself.
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Civil 3D Structures and surfaces
« Reply #2 on: November 04, 2010, 05:48:36 PM »
This is one of those areas where lisp falls flat on it's face with C3D. The Structure's Surface property is expecting you to pass it a Surface object, not the name, but even the object won't be good enough if it's a TinSurface because, well, a TinSurface does not match the requirement of a Surface (it should, but it doesn't) so this fails, too.

You CAN globally assign the Surface to all of the Structures, however, via either the Prospector or PipeNetwork Editor. Select the structures, right-click the Reference Surface column header and select the desired surface name.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Civil 3D Structures and surfaces
« Reply #3 on: November 04, 2010, 05:56:26 PM »
I like the last part of the above as an option...


or


if you just want to do it as a program perhpas one could write the pipe files the you want to change out to a(n) XML file, edit that file, and reimport the pipe run
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Civil 3D Structures and surfaces
« Reply #4 on: November 04, 2010, 06:14:11 PM »
Or, write it in another language.....I'm almost positive this could be done in C# & VB.NET, possibly even VBA. It's just lisp has no real concept of OOP.

jmcshane

  • Newt
  • Posts: 83
Re: Civil 3D Structures and surfaces
« Reply #5 on: November 09, 2010, 01:20:11 PM »
Sorry for taking so long to get back to you. I've been swamped at work here this last few days.
Thank you all for your help, as well as learning something about lisp, you have saved me a load of time by not pursuing
something which couldn't be done.

Cheers

John

« Last Edit: November 10, 2010, 05:23:24 AM by jmcshane »
John.

Civil 3D 2021. Windows 10