Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with Property Sets--Invert of Pipes

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
josh.byers
4518 Views, 19 Replies

Help with Property Sets--Invert of Pipes

I am trying to create a property set that would allow me to click on a pipe and view it's start and end invert. I know I can see this in the properties menu now but when I export to Navisworks, this information does not follow the pipe. The property set formula that I used to determine the inner diameter size is listed below. I was wondering if anyone knows the correct object code for the Start and End Invert. I have tried obj.StartInvertElevation, obj.EndInvertElevation, and everything in between and cannot figure it out. Thanks in advance!

 

Result="--"
On Error Resume Next
Set oApp=GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("AeccXUiLand.AeccApplication.11.0")
Set obj=oCivilApp.ActiveDocument.HandleToObject("[Handle]")
RESULT=obj.InnerDiameterOrWidth*12

19 REPLIES 19
Message 2 of 20
MikeEvansUK
in reply to: josh.byers

You need to cycle through the pipes / structures one by one or pick a structure then you can obtain information about it.

 

in your code obj is a handle not a pipe so you won't get any pipe information.

 

Look for examples.

 

To me if you're not familiar with Vb.net you'd be better off using Pipe to excel example which ships with Civil3d (in examples I think) then using the "Handle" to import the data you want to navisworks via odbc. That is until Autodesk Automate the population of Pipe information to Properties.

 

M

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

Message 3 of 20
tyronebk
in reply to: MikeEvansUK

Josh is asking about Property Sets, but your response seems to not really acknowledge that. Here is some information on working with Property Sets if you aren't familiar.

 

Unfortunately I haven't been successful in getting you what you want, but, based on the interface properties and methods, should be something like:

 

RESULT= obj.StartPoint.Z-obj.InnerDiameterOrWidth/2

For some reason the StartPoint and EndPoint objects don't return any information.

 

I noticed that when using vlax-dump-object on pipes the output shows:

 

;   EndPoint (RO) = #<VLA-OBJECT 00000...>
;   StartPoint (RO) = #<VLA-OBJECT 00000...>

Which doesn't include the interface type. Position though, does, even though they are the same interface/class, IAeccPoint3d:

;   Position (RO) = #<VLA-OBJECT IAeccPoint3d 00000...>

 

Calling obj.Position.Z in the property set code definitely works, unlike StartPoint/EndPoint, but always equals zero so it doesn't help us in any way. Can you cast StartPoint/EdnPoint as a IAeccPoint3d somehow?

 

Message 4 of 20
MikeEvansUK
in reply to: tyronebk

Sorry, I have a program already which converts this detail directly in .net rather than Lsp.

 

The issue is he cant get the start or end point from an active document Handle. (Obj = activedocument.Handle).

 

You must target the application, get the network then find the pipe.

 

 For Each opipeid In NET_PipeNetwork.GetPipeIds
                    Dim NetPipe As Autodesk.Civil.DatabaseServices.Pipe
                    NetPipe = DirectCast(m_trans.GetObject(opipeid, OpenMode.ForRead, True), Autodesk.Civil.DatabaseServices.Pipe)
                    Dim oPipe As aeccPipe = NetPipe.AcadObject

                    Try
                        Dim dbObj As Autodesk.AutoCAD.DatabaseServices.DBObject = m_trans.GetObject(opipeid, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead)

                        If Not dictPipeIFC.ContainsKey(oPipe.Name) Then
                            dictPipeIFC.Add("Name", oPipe.Name)
                        End If
                        If Not dictPipeIFC.ContainsKey("Type") Then
                            dictPipeIFC.Add("ObjectType", oPipe.PartSizeName)
                        End If

                        oPartDataRecord = oPipe.PartDataRecord
                        AddPipeData(dictPipe, "Name", oPipe.Name)
                        AddPipeData(dictPipe, "Handle", oPipe.Handle.ToString)
                        AddPipeData(dictPipe, "StartCoordinatesEN", (Math.Round(oPipe.StartPoint.X, 3) & "," & Math.Round(oPipe.StartPoint.Y, 3)).ToString)
                        AddPipeData(dictPipe, "EndCoordinatesEN", Math.Round(oPipe.EndPoint.X, 3) & "," & Math.Round(oPipe.EndPoint.Y, 3).ToString)
                        AddPipeData(dictPipe, "StartInvert", (Math.Round(oPipe.StartPoint.Z - (oPipe.InnerDiameterOrWidth / 2), 3)).ToString)
                        AddPipeData(dictPipe, "EndInvert", Math.Round(oPipe.EndPoint.Z - (oPipe.InnerDiameterOrWidth / 2), 3).ToString)
                        AddPipeData(dictPipe, "StartCrown", Math.Round(oPipe.StartPoint.Z + (oPipe.InnerDiameterOrWidth / 2), 3).ToString)
                        AddPipeData(dictPipe, "EndCrown", Math.Round(oPipe.EndPoint.Z + (oPipe.InnerDiameterOrWidth / 2), 3).ToString)
                        AddPipeData(dictPipe, "InnerDiameterorWidth", Math.Round(oPipe.InnerDiameterOrWidth, 3).ToString)
                        AddPipeData(dictPipe, "InnerHeight", Math.Round(oPipe.InnerHeight, 3).ToString)
                        AddPipeData(dictPipe, "Wall Thickness", Math.Round(oPipe.WallThickness, 3).ToString)
                        AddPipeData(dictPipe, "Slope", Math.Round(oPipe.Slope, 3).ToString)
                        AddPipeData(dictPipe, "Description", oPipe.Description)
                        AddPipeData(dictPipe, "3DLengthCtoC", Math.Round(NetPipe.Length3DCenterToCenter, 3).ToString)
                        AddPipeData(dictPipe, "3DLengthToInsideEdges", Math.Round(NetPipe.Length3DToInsideEdge, 3).ToString)
                        AddPipeData(dictPipe, "PartFamilyName", oPipe.PartFamily.Name)
                        AddPipeData(dictPipe, "PartFamilyGuid", oPipe.PartFamily.Guid.ToString)
                        AddPipeData(dictPipe, "PartSizeName", oPipe.PartSizeName)
                        If Not oPipe.StartStructure Is Nothing Then
                            AddPipeData(dictPipe, "StartStructure", oPipe.StartStructure.Name)
                        End If
                        AddPipeData(dictPipe, "StartCover", Math.Round(NetPipe.CoverOfStartPoint, 3).ToString)
                        AddPipeData(dictPipe, "EndCover", Math.Round(NetPipe.CoverOfEndpoint, 3).ToString)
                        If Not oPipe.EndStructure Is Nothing Then
                            AddPipeData(dictPipe, "EndStructure", oPipe.EndStructure.Name)
                        End If
                        AddPipeData(dictPipe, "MinCover", Math.Round(oPipe.MinimumCover, 3).ToString)
                        AddPipeData(dictPipe, "MaxCover", Math.Round(oPipe.MaximumCover, 3).ToString)
                        AddPipeData(dictPipe, "HydraulicGradient Up", Math.Round(oPipe.HGLUp, 3).ToString)
                        AddPipeData(dictPipe, "HydraulicGradient Down", Math.Round(oPipe.HGLUp, 3).ToString)
                        AddPipeData(dictPipe, "EnergyGradient Up", Math.Round(oPipe.EGLUp, 3).ToString)
                        AddPipeData(dictPipe, "EnergyGradient Down", Math.Round(oPipe.EGLDown, 3).ToString)
                        AddPipeData(dictPipe, "Manufacturer", "Unknown")

                        'For n = 0 To oPartDataRecord.Count - 1
                        For Each oPartDataField In oPartDataRecord

                            If Not dictPipe.ContainsKey(oPartDataField.ContextString) Then
                                Dim test As String = oPartDataField.ContextString
                                AddPipeData(dictPipe, oPartDataField.ContextString, oPartDataField.Tag.ToString)

                            End If

                        Next

using the pipe(.net) you get a 3d point as the position x,y,z but these are visible by stating which one you want.

 

Once you have this you can create the part property sets, search for Architecture who harnessed this functionality a long time ago. That's where I found the answers to do this pragmatically.

 

M

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

Message 5 of 20
josh.byers
in reply to: MikeEvansUK

This definitely helps. Thanks!

Message 6 of 20
tyronebk
in reply to: MikeEvansUK

Thanks for the info Mike. Just to clarify, you are storing this data on the pipe object as an extension dictionary or something? Your code sample has things going on that are not defined in the code so it's tough to extrapolate.

 

What is special about StartPoint and EndPoint where you can't get info for them when you can for basically every other pipe property using the newly added Property Sets functionality?

PropertySets.PNG

Result="--"
On Error Resume Next
Set oApp=GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("AeccXUiLand.AeccApplication.11.0")
Set obj=oCivilApp.ActiveDocument.HandleToObject("[Handle]")
RESULT=obj.EndStructure.RimElevation
Message 7 of 20
Jeff_M
in reply to: josh.byers

There is something about arrays, 3dpoints, etc., that the property sets code is not recognizing. I have tried a number of objects, from polylines to pipes, any property that has multiple items, i.e.a point,it fails to recognize.
Jeff_M, also a frequent Swamper
EESignature
Message 8 of 20
MikeEvansUK
in reply to: Jeff_M

Jeff, I added a dictionary object (of strings) to hold the data strings for the pipe/structure info. The command to write the property data allows the dictionary of strings. So if you are trying to add a 3dpoint I would enter all values Pipe.Startpoint.X.tostring etc this populates the information correctly as far as I can see.

 

Public Shared dictPipe As New Dictionary(Of String, String)

 

AddPropsTabs("Pipework Table Details", opipeid, dictPipe, obid, NET_PipeNetwork.Name & "_" & NetPipe.Name)

 

Hope this helps.

 

M

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

Message 9 of 20
Jeff_M
in reply to: josh.byers

Mike, you seem to be confusing .NET code with the new Property sets which uses VBSCRIPT and COM. The OP asked about PropertySets....
Jeff_M, also a frequent Swamper
EESignature
Message 10 of 20
MikeEvansUK
in reply to: Jeff_M

Sorry Jeff, Now I am confused - What am I missing here. When you say "New" don't your really mean "old" Property Sets. : )

 

What is the difference between Architecture's "Property Sets" (Circa 2006) & "PropertySets" ?

 

What am I missing here, please can you let me know.

 

 

Thanks

 

 

 

 

 

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

Message 11 of 20
Jeff_M
in reply to: MikeEvansUK

Yes, Mike, the 'newly exposed to C3D users' propertysets that the AEC users have had for some time. Re-reading the previous posts, I now think I see that you have .NET code to populate dictionaries that can then be used with the property sets. Is that right? If so, great, but IMHO these properties should be accessible without the additional programming so 'the masses' can actually put them to use.
Jeff_M, also a frequent Swamper
EESignature
Message 12 of 20
MikeEvansUK
in reply to: Jeff_M

Ahh, I see what you meant now, I wasn't aware of another method to populate (didn't look after I had a working method. Yes I am using dictionary to populate in one go and yes it works fine.

 

Sorry when the "New feature" dropped on the Beta it was only using corridor strings OTB so I read up in the Architecture forums for the method to populate via .net.

 

I wasn't aware there was another method to do this, I believe the goal in the long term should be to Self Populate the data rather than having to do this manually.

 

I only really use it to export to navisworks or to export Pipe networks to IFC for Revit. The data imports to revit but is not usable as it's project shared parameters not object or something like that.

 

Do you have any links to info / examples / to populate in the different way or is it in the help files - I'm assuming it will be better than .net.

 

 

All the best

 

Mike

 

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

Message 13 of 20
MikeEvansUK
in reply to: MikeEvansUK

Jeff, I did a bit of searching and found the answer to this (as you had pointed out) using VBA in the MEP discussion group.

 

http://forums.autodesk.com/t5/autocad-architecture-forum/property-set-definitions/td-p/4861826

 

It seems that you can use the "Handle" once you have added it to assign parameters to the property sets automatically but there is one significant downfall. So far I haven't been able to retrieve Custom contexts from the item so back to the drawing board here. Same problem and the old NWCOut.

 

It may be that you can just add the full VBa code to obtain the information from the PartDataRecords but this should (as you said previously) be simple enough for someone without programming language skills to do.

 

I'll keep playing and see what happens, it may be simpler onc3e I remeber the old way of writing VBa.

 

Thanks

 

 

 

M

 

Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

Message 14 of 20
Jason.Kroll
in reply to: josh.byers

Did anyone ever have any luck with this?

 

It's very frustrating not being able to access this information.

 

Jason

Message 15 of 20
hippe013
in reply to: tyronebk

I understand that this thread already has a solution. Though I am replying in regards to obtaining the start and end points of a pipe (Civil 3D) using Visual Lisp.

 

I way that one would think to get the start and end points would be to get the property (vlax-get-property PipeObj 'StartPoint) and (vlax-get-property PipeObj 'EndPoint)

 

The above code does not produce expected results.

 

For StartPoint of a Pipe use:

(vlax-get-property PipeObj 'PointAtParam 0)

 

For EndPoint of a Pipe use:

(vlax-get-property PipeObj 'PointAtParam 1)

 

 

Message 16 of 20
Jason.Kroll
in reply to: hippe013

Thanks for your response.

 

I also tried your approach with the VBA code necessary to add it to the Formula Property Definition dialog when creating Property Sets (as per the OP's original question) however no luck. Not sure why the OP marked the .net approach as a solution as it is only a workaround to the actual problem.

 

Cheers.

 

Message 17 of 20

I am not familiar with VBA codes, Can you give me steps to insert this to Civil 3d

Thanks in advance ...

Tags (1)
Message 18 of 20
ren26_1984
in reply to: Khaled_Bahnasy

good afternoon
from South America Peru

I am trying to create a style of label for structures, where the elevation of conditionally connected pipes is shown. That is to say, when the inverted elevation of the pipe is = a rise of the bottom of the structure, it is not shown and when it is greater than the elevation of the bottom of the structure it is shown.

this could be with the civil 3d expressions, but unfortunately the elevations of the connections of the pipes to the structures in the expressions are not shown.

this tag could be done with some code in property sets of civil 3d?
or with some programming language of civil 3d?

I was trying with property sets for the structure tag but it does not return any value, not even from the structure itself.

can someone please tell me how to do this, or what programming language should I learn to make this dynamic and conditional label in civil 3d?

regards

Renzo rproperty set connect pipe.jpg

Message 19 of 20
mehsan
in reply to: tyronebk

I can the image attach for all the property sets for Pipes and Structure in the image belwo can any one provide the Formula for all these ,

Thanks

Message 20 of 20
yair.zini
in reply to: tyronebk

HI

I'm trying to find the formula for PIPE IL IN.

Your formula probably doesn't work in version 2023. Any idea?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report