Structure Connected Pipes Invert Level

Structure Connected Pipes Invert Level

ronald.parangat
Participant Participant
1,718 Views
10 Replies
Message 1 of 11

Structure Connected Pipes Invert Level

ronald.parangat
Participant
Participant

Hi, I am trying to extract the connected pipe(s) invert level using VB script. I am new to Civil3D .net api. I would like to be able iterate it for multiple connected pipes. The script I wrote looks like this. 

 

RESULT="--"
On Error Resume Next
Set oApp=GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.13.2")
Set obj=oCivilApp.ActiveDocument.HandleToObject("[Handle]")
RESULT= obj.ConnectedPipe.InvertLevel

 

Grateful if somebody could provide some help.

0 Likes
1,719 Views
10 Replies
Replies (10)
Message 2 of 11

hosneyalaa
Advisor
Advisor
0 Likes
Message 3 of 11

ronald.parangat
Participant
Participant

Thanks for your reply. I have seen this thread. But I want to extract the connected pipes invert level within the structure. To be more precise, I want to be able to see the pipe invert levels on the extended data property set attached to the structures. 

 

The code from your link is extracting the pipe invert levels on the extended data property set attached to the pipes. I am using that code aswell.

0 Likes
Message 4 of 11

hosneyalaa
Advisor
Advisor

ss1.gif

0 Likes
Message 5 of 11

hosneyalaa
Advisor
Advisor

ss3.gifss2.gif

0 Likes
Message 6 of 11

hosneyalaa
Advisor
Advisor
RESULT="--"

On Error Resume Next

Set oApp=GetObject(, "AutoCAD.Application")

Set oCivilApp=oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.13.4")

Set obj=oCivilApp.ActiveDocument.HandleToObject("[Handle]")
sp1 = obj.PipeCenterDepth(1)
sp2 =  obj.RimElevation 
RESULT=(sp2 -sp1 )
0 Likes
Message 7 of 11

ronald.parangat
Participant
Participant

This code seems to not work.  I understand the code but when I checked my sp1 is resulting in error. Im using C3d 2020 by the way. I just put "28ee" in the handle just for my example. sp2 seems to work fine.

invert level a1.PNG

0 Likes
Message 8 of 11

hosneyalaa
Advisor
Advisor

Put (0)  indeed (1) 

Or

Attached drawing for structure

0 Likes
Message 9 of 11

ronald.parangat
Participant
Participant

Oh the code works when I tried sp1 = obj.PipeCenterDepth(2), sp1 = obj.PipeCenterDepth(3), sp1 = obj.PipeCenterDepth(4). Why is my pipe index 2,3,4? why not 0,1,2?

0 Likes
Message 10 of 11

hosneyalaa
Advisor
Advisor

The numbers indicate the number of connected pipes
For the first sp1 = obj.PipeCenterDepth (0)
The second sp2 = obj.PipeCenterDepth (1)
And so on

 

0 Likes
Message 11 of 11

ronald.parangat
Participant
Participant

Seems like the index of the connected pipes does not always start with 0. For example, one of my structures has returned the  value for the first pipe with index "2", i .e. sp1 = obj.PipeCenterDepth(2). 

0 Likes