TheSwamp

CAD Forums => Vertically Challenged => Land Lubber / Geographically Positioned => Topic started by: MSTG007 on August 22, 2018, 02:28:03 PM

Title: Shapefile ObjectData to Property Set Definitions
Post by: MSTG007 on August 22, 2018, 02:28:03 PM
Someone mentioned that it would be nice to have shape file object data be linked to property set definitions in order to utilize the Civil3D Labels. They mentioned since a property set could be read from a civil3d label. You could attach a label that pulls the property set of a line then use that as a label. Makes some sense if it works.
Thanks for any feedback.
Title: Re: Shapefile ObjectData to Property Set Definitions
Post by: mjfarrell on August 23, 2018, 04:07:00 PM
I don't see how object data is shared with Property Set definitions?

However you could already use annotation styles to label things with object data attached to them
Title: Re: Shapefile ObjectData to Property Set Definitions
Post by: MSTG007 on August 23, 2018, 04:19:40 PM
You are right. But with annotations, there needs to be a definite scale. it can not be "just a random zoom within a viewport". Unless (I hope ) I am wrong.
Title: Re: Shapefile ObjectData to Property Set Definitions
Post by: mjfarrell on August 23, 2018, 05:07:59 PM
You are right. But with annotations, there needs to be a definite scale. it can not be "just a random zoom within a viewport". Unless (I hope ) I am wrong.

Or use the MAP explorer if you want the labels to dynamically zoom...I guess I need to better understand what you after and what workflow this will be part of?

The annotation templates can be Annotative these days....but yes a real scale helps in viewports.
Title: Re: Shapefile ObjectData to Property Set Definitions
Post by: Rod on August 23, 2018, 10:27:26 PM
I was able to extract and write to Property set definitions with lisp. I was using Civil 2017

But only after I had installed Autocad Architecture 2017 (trial) the lisp continued to work after the trial had expired.

My solution was more of a workaround. Hopefully they have started including the COM interfaces I was using in later versions.

Let me see if I can dig up my lisp.

I'm interested if anyone has a better solution to red/write to property set data.

Cheers, Rod
Title: Re: Shapefile ObjectData to Property Set Definitions
Post by: MSTG007 on August 23, 2018, 10:34:39 PM
That sounds crazy cool. Just want to understand it alittle but more. You would select the objects that have a certain field within the object data. Then it would create a property set catalogue. Then copy the object data field into the property set definition.

If it works like that... all I have to do is create a civil3d line label and attach it to the line with it pulling that property set info into the label!

Thanks for the info that it is possible.
Title: Re: Shapefile ObjectData to Property Set Definitions
Post by: Rod on August 23, 2018, 10:36:16 PM
I haven't needed it yet but here is.

It required Autocad architecture to be installed. I used a trial.

Not sure how this would work with Autocad One.

If you take this further please post any success / failure on theswamp for myself and others

Also you would need to change the version number in AecX.AecScheduleApplication.7.9 to suit your version

Code - Auto/Visual Lisp: [Select]
  1. (defun C:test ()
  2.   (setq vlaObj          (vlax-ename->vla-object (car (entsel "Select a Object ")))
  3.         acadObj         (vlax-get-acad-object)
  4.         schedApp        (vla-getInterfaceObject
  5.                           acadObj
  6.                           "AecX.AecScheduleApplication.7.9"
  7.                         )
  8.         propSets        (vlax-invoke-method schedApp 'PropertySets vlaObj)
  9.         psdName         "New Style"
  10.         propSet         (vlax-invoke-method propSets 'Item psdName)
  11.         properties      (vlax-get-property propSet 'Properties)
  12.         propNameValList (reverse
  13.                           (vlax-for prop properties
  14.                             (setq propNameValList
  15.                                    (cons
  16.                                      (cons
  17.                                        (vlax-get-property prop 'Name)
  18.                                        (vlax-variant-value
  19.                                          (vlax-get-property prop 'Value)
  20.                                        )
  21.                                      )
  22.                                      propNameValList
  23.                                    )
  24.                             )
  25.                           )
  26.                         )
  27.   )
  28. )
Title: Re: Shapefile ObjectData to Property Set Definitions
Post by: MSTG007 on August 23, 2018, 10:39:55 PM
Thank you! I’ll take a stab at it! I might have questions, like I always do but thank you for sharing again.
Title: Re: Shapefile ObjectData to Property Set Definitions
Post by: Rod on August 23, 2018, 10:43:10 PM
No worries. It will only get you started but I hope it helps