Author Topic: Civil 3D | Property Sets  (Read 7884 times)

0 Members and 1 Guest are viewing this topic.

BlackBox

  • King Gator
  • Posts: 3770
Civil 3D | Property Sets
« on: August 17, 2016, 10:19:42 AM »
Never really used this before, so could use some guidance, as there doesn't seem to be a good amount of examples in some searching yesterday.

How does one go about adding Coordinates Property Set to a Polyline?

Polylines have a Coordinates Property (Variant type), but I cannot seem to find a way to add this as a Property Set - not even when using VBA code to iterate the Polyline's Coordinates Property to build an array of Doubles.

For that matter, I could not even get the Start Point to display using plineObj.Coordinate(0).

Also, why are Property Sets dependent on VBA; no .NET (within the Formula, that is)?


TIA
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D | Property Sets
« Reply #1 on: August 17, 2016, 11:40:37 AM »
Here's what I started with:

http://autodesk.typepad.com/bimtoolbox/2016/02/autodesk-2016-aec-showreel-call-for-submissions.html


After adding the ObjectId auto-property (I also tried Handle + HandleToObject Method), I used the following snippets to try and populate Formulas.



Here's a VBA snippet to try and get the Start_Point (which doesn't work):
Code - vb.net: [Select]
  1. Dim RESULT() as Double
  2. On Error Resume Next
  3. Set oApp=GetObject("AutoCAD.Application.20")
  4. Set obj=oApp.ActiveDocument.ObjectIdToObject([ObjectID])
  5. RESULT=obj.Coordinate(0)
  6.  



Here's a VBA snippet to try and get the all Coordinates (which also doesn't work):
Code - vb.net: [Select]
  1. Dim cnt As Integer
  2. Dim i As Integer
  3. Dim j As Integer
  4. Dim iStep As Integer
  5. Dim dblCoords() As Double
  6. Dim RESULT() as Double
  7.  
  8. Set oApp=GetObject("AutoCAD.Application.20")
  9. Set obj=oApp.ActiveDocument.ObjectIdToObject([ObjectID])
  10.  
  11. dblCoords = obj.Coordinates
  12.  
  13. ReDim ptsArr(0 To (UBound(dblCoords) + 1) \ iStep - 1, 0 To iStep - 1) As Double
  14. For i = 0 To (UBound(dblCoords) + 1) \ iStep - 1
  15.   For j = 0 To iStep - 1
  16.            ptsArr(i, j) = dblCoords(cnt)
  17.            Debug.Print ptsArr(i, j)
  18.            cnt = cnt + 1
  19.   Next
  20. Next
  21. RESULT = ptsArr
  22.  
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: Civil 3D | Property Sets
« Reply #2 on: August 17, 2016, 03:55:01 PM »
BB, there are only a few supported Formats for output. As far as I have been able to test, you cannot Set this in the Formula, but only in the Format Type. These Types are: Text, Integer, Real, True/False. I have tried this, which I thought would work, to no avail, I can get other properties, but no coordinates.

Code - vb.net: [Select]
  1. RESULT=0
  2. On Error Resume Next
  3. Set oApp=GetObject(, "AutoCAD.Application")
  4. Set obj=oApp.ActiveDocument.ObjectIdToObject([ObjectID])
  5. coord = obj.Coordinate(0)
  6. RESULT=coord(0)
  7.  

I have no clue why they went with quasi-VBA for the formulas. Note that they don't require the Dim xxx As xxxx

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Civil 3D | Property Sets
« Reply #3 on: August 18, 2016, 09:08:06 AM »
why do you want to?

I'm wondering what would be a use of having coordinates attached, or defined to a polyline?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D | Property Sets
« Reply #4 on: August 18, 2016, 04:33:06 PM »
BB, there are only a few supported Formats for output. As far as I have been able to test, you cannot Set this in the Formula, but only in the Format Type. These Types are: Text, Integer, Real, True/False. I have tried this, which I thought would work, to no avail, I can get other properties, but no coordinates.

Code - vb.net: [Select]
  1. RESULT=0
  2. On Error Resume Next
  3. Set oApp=GetObject(, "AutoCAD.Application")
  4. Set obj=oApp.ActiveDocument.ObjectIdToObject([ObjectID])
  5. coord = obj.Coordinate(0)
  6. RESULT=coord(0)
  7.  

I have no clue why they went with quasi-VBA for the formulas. Note that they don't require the Dim xxx As xxxx

Thanks, Jeff!




why do you want to?

I'm wondering what would be a use of having coordinates attached, or defined to a polyline?

So they'd show up in Navisworks..?

One of the forum admins there asked if I could help the OP out with Property Sets... I couldn't figure out how to use the Property Sets for the requested Coordinates, so I posted here hoping that I was overlooking something, and it instead appears to be a limitation of the Architectural integration.



Cheers
"How we think determines what we do, and what we do determines what we get."

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Civil 3D | Property Sets
« Reply #5 on: August 18, 2016, 05:54:47 PM »
what if you you placed a special block @ polyline vertices through points at/along polyline vertices, and grab the data from those blocks?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D | Property Sets
« Reply #6 on: August 19, 2016, 11:08:45 AM »
what if you you placed a special block @ polyline vertices through points at/along polyline vertices, and grab the data from those blocks?

How is that manual process less work than simply adding Line and Curve Labels, where you might see the values without selecting anything?
"How we think determines what we do, and what we do determines what we get."

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Civil 3D | Property Sets
« Reply #7 on: August 19, 2016, 12:17:49 PM »
what if you you placed a special block @ polyline vertices through points at/along polyline vertices, and grab the data from those blocks?

How is that manual process less work than simply adding Line and Curve Labels, where you might see the values without selecting anything?

Due to my not quite understanding exactly what or why, I offer a suggestion that may or may not seem suitable for your needs.

Perhaps an illustration and and an explanation  of what you expect to show up outside of civil 3d would prove more effective?

Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D | Property Sets
« Reply #8 on: August 19, 2016, 04:47:33 PM »
what if you you placed a special block @ polyline vertices through points at/along polyline vertices, and grab the data from those blocks?

How is that manual process less work than simply adding Line and Curve Labels, where you might see the values without selecting anything?

Due to my not quite understanding exactly what or why, I offer a suggestion that may or may not seem suitable for your needs.

Perhaps an illustration and and an explanation  of what you expect to show up outside of civil 3d would prove more effective?

No worries, MJF - I was only attempting this to help the user in the linked thread, and to see if I was missing something simple.


Cheers
"How we think determines what we do, and what we do determines what we get."

VitalyF

  • Mosquito
  • Posts: 6
Re: Civil 3D | Property Sets
« Reply #9 on: September 18, 2016, 03:59:56 PM »
Hi all,
How does one go about adding Coordinates Property Set to a Polyline?

I do not have Civil 3D, so my example for AutoCAD MEP 2017

Code - vb.net: [Select]
  1. RESULT="--"
  2. On Error Resume Next
  3. Set app=GetObject(, "AutoCAD.Application")
  4. Set aec = app.GetInterfaceObject("AecX.AecBaseApplication.7.9")
  5. aec.Init app
  6. Set obj=app.ActiveDocument.ObjectIdToObject([ObjectID])
  7. pt = aec.ActiveDocument.Utility.ConvertToVariantArray(obj.Coordinates)
  8. RESULT = "X= " & pt(0) & " Y=" & pt(1)

Where - AecX.AecBaseApplication.7.9- your AEC Version



Best regards!


Rod

  • Newt
  • Posts: 185
Re: Civil 3D | Property Sets
« Reply #10 on: September 19, 2016, 08:41:55 AM »
Saw this http://forums.autodesk.com/t5/autocad-architecture/space-object-elevation-property/td-p/3739563 recently thought it might help. Looks like VitalyF beat me though.
See a lot of potential in using these property sets
"All models are wrong, some models are useful" - George Box