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

0 Members and 1 Guest are viewing this topic.

#### BlackBox

• King Gator
• Posts: 3742
##### 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
"Potential has a shelf life." - Margaret Atwood

#### BlackBox

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

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]
`Dim RESULT() as DoubleOn Error Resume NextSet oApp=GetObject("AutoCAD.Application.20")Set obj=oApp.ActiveDocument.ObjectIdToObject([ObjectID])RESULT=obj.Coordinate(0) `

Here's a VBA snippet to try and get the all Coordinates (which also doesn't work):
Code - vb.net: [Select]
`Dim cnt As IntegerDim i As IntegerDim j As IntegerDim iStep As IntegerDim dblCoords() As DoubleDim RESULT() as Double Set oApp=GetObject("AutoCAD.Application.20")Set obj=oApp.ActiveDocument.ObjectIdToObject([ObjectID]) dblCoords = obj.Coordinates ReDim ptsArr(0 To (UBound(dblCoords) + 1) \ iStep - 1, 0 To iStep - 1) As DoubleFor i = 0 To (UBound(dblCoords) + 1) \ iStep - 1  For j = 0 To iStep - 1	   ptsArr(i, j) = dblCoords(cnt)	   Debug.Print ptsArr(i, j)	   cnt = cnt + 1  NextNextRESULT = ptsArr `
"Potential has a shelf life." - Margaret Atwood

#### Jeff_M

• King Gator
• Posts: 3891
• 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]
`RESULT=0On Error Resume NextSet oApp=GetObject(, "AutoCAD.Application")Set obj=oApp.ActiveDocument.ObjectIdToObject([ObjectID])coord = obj.Coordinate(0)RESULT=coord(0) `

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: 13921
• 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?

Michael Farrell
http://primeservicesglobal.com/

#### BlackBox

• King Gator
• Posts: 3742
##### 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]
`RESULT=0On Error Resume NextSet oApp=GetObject(, "AutoCAD.Application")Set obj=oApp.ActiveDocument.ObjectIdToObject([ObjectID])coord = obj.Coordinate(0)RESULT=coord(0) `

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
"Potential has a shelf life." - Margaret Atwood

#### mjfarrell

• Seagull
• Posts: 13921
• 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?

Michael Farrell
http://primeservicesglobal.com/

#### BlackBox

• King Gator
• Posts: 3742
##### 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?
"Potential has a shelf life." - Margaret Atwood

#### mjfarrell

• Seagull
• Posts: 13921
• 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?

Michael Farrell
http://primeservicesglobal.com/

#### BlackBox

• King Gator
• Posts: 3742
##### 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
"Potential has a shelf life." - Margaret Atwood

#### 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]
`RESULT="--"On Error Resume NextSet app=GetObject(, "AutoCAD.Application")Set aec = app.GetInterfaceObject("AecX.AecBaseApplication.7.9")aec.Init appSet obj=app.ActiveDocument.ObjectIdToObject([ObjectID])pt = aec.ActiveDocument.Utility.ConvertToVariantArray(obj.Coordinates)RESULT = "X= " & pt(0) & " Y=" & pt(1)`

Where - AecX.AecBaseApplication.7.9- your AEC Version

Best regards!

#### Ausrod

• Newt
• Posts: 58
##### 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