Property Set Data : Fetching the Inverts at the beggining and ending of a pipe with 3 decimals, how ?

Property Set Data : Fetching the Inverts at the beggining and ending of a pipe with 3 decimals, how ?

cyberflow
Advisor Advisor
645 Views
6 Replies
Message 1 of 7

Property Set Data : Fetching the Inverts at the beggining and ending of a pipe with 3 decimals, how ?

cyberflow
Advisor
Advisor

Hi all,

I've been trying to make this work with 3 digits but it seems not to be working by adding a round() into it but the information contains only 2 decimals ...

How can we format this line so it outputs 3 decimals ?

spos = aec.ActiveDocument.Utility.ConvertToVariantArray(obj.PointAtParam(1))	

 

cyberflow_0-1720711978554.png

 

 


FYI here's the VB scripts : 

Property set data VB script for Inlet Invert (Return 2 decimals) : 

RESULT = "--"
On Error Resume Next
Set oApp = GetObject(, "AutoCAD.Application")
Set oCivilApp = oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.13.5")
Set aec = oApp.GetInterfaceObject("AecX.AecBaseApplication.8.5")
aec.Init oApp
Set obj = oCivilApp.ActiveDocument.HandleToObject("[Handle]")

spos = aec.ActiveDocument.Utility.ConvertToVariantArray(obj.PointAtParam(0))
RESULT = round(spos(2),3)

 
Property set data for Oulet Invert (Return 2 decimals) : 

RESULT = "--"
On Error Resume Next
Set oApp = GetObject(, "AutoCAD.Application")
Set oCivilApp = oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.13.5")
Set aec = oApp.GetInterfaceObject("AecX.AecBaseApplication.8.5")
aec.Init oApp
Set obj = oCivilApp.ActiveDocument.HandleToObject("[Handle]")

spos = aec.ActiveDocument.Utility.ConvertToVariantArray(obj.PointAtParam(1))	
RESULT = spos(2)

 

Frank Freitas

CAE/CAD/BIM Coordinator & Support Specialist

LinkedIn
0 Likes
Accepted solutions (3)
646 Views
6 Replies
Replies (6)
Message 2 of 7

cyberflow
Advisor
Advisor

I just noticed something : 

The code in the property set data sends out incorrect inverts : 

The correct inverts : 

cyberflow_0-1720712879655.png



The inverts returned from the property set data VB Scripts : 

cyberflow_1-1720712931849.png



Is it normal ?

Frank Freitas

CAE/CAD/BIM Coordinator & Support Specialist

LinkedIn
Message 3 of 7

lim.wendy
Alumni
Alumni
Accepted solution

Hi Frank,

 

Thank you for submitting your question in our discussion forums. 

Have you tried adjusting the precision from the Property Data Style Manager?

 


 

Please let us know if you require further assistance.

If the suggestions helped you, please hit the "Accept Solution" button, as it helps make the solution easier to find for others who might have the same issue. Knowing which topics are solved or not can also help our many users find the questions that still need to be answered. It’s also a great way to say thank you and give recognition to whoever helped you. 


 

 



Wendy Lim

Data Nerd | Community Advocate | AEC Industry


facebook twitter twitter blogs pm


Join the new online Rail Community


Rails Summit




Message 4 of 7

cyberflow
Advisor
Advisor

Hi @lim.wendy  !

Thx for answering !

That seems pretty neat but i wonder why it doesn't give the correct invert ?

cyberflow_0-1721276590887.png



RadierDebut = Start Invert
RadierFin = End Invert

cyberflow_1-1721276637919.png



I feel like it's giving the centerline Z of the vertice ?

Frank Freitas

CAE/CAD/BIM Coordinator & Support Specialist

LinkedIn
0 Likes
Message 5 of 7

cyberflow
Advisor
Advisor

Start invert VBscript : 

RESULT = "--"
On Error Resume Next
Set oApp = GetObject(, "AutoCAD.Application")
Set oCivilApp = oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.13.6")
Set aec = oApp.GetInterfaceObject("AecX.AecBaseApplication.8.6")
aec.Init oApp
Set obj = oCivilApp.ActiveDocument.HandleToObject("[Handle]")

spos = aec.ActiveDocument.Utility.ConvertToVariantArray(obj.PointAtParam(0))
RESULT = spos(2)



End invert VBscript :

RESULT = "--"
On Error Resume Next
Set oApp = GetObject(, "AutoCAD.Application")
Set oCivilApp = oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.13.6")
Set aec = oApp.GetInterfaceObject("AecX.AecBaseApplication.8.6")
aec.Init oApp
Set obj = oCivilApp.ActiveDocument.HandleToObject("[Handle]")

spos = aec.ActiveDocument.Utility.ConvertToVariantArray(obj.PointAtParam(1))	
RESULT = spos(2)



Frank Freitas

CAE/CAD/BIM Coordinator & Support Specialist

LinkedIn
0 Likes
Message 6 of 7

Jeff_M
Consultant
Consultant
Accepted solution

@cyberflow wrote:

I feel like it's giving the centerline Z of the vertice ?


It is. You will need to get the InnerHeight and subtract 1/2 of that from the Z obtained.

Jeff_M, also a frequent Swamper
EESignature
Message 7 of 7

cyberflow
Advisor
Advisor
Accepted solution

Hey hi @Jeff_M 
This did work :


End Invert : 

RESULT = "--"
On Error Resume Next
Set oApp = GetObject(, "AutoCAD.Application")
Set oCivilApp = oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.13.6")
Set aec = oApp.GetInterfaceObject("AecX.AecBaseApplication.8.6")
aec.Init oApp
Set obj = oCivilApp.ActiveDocument.HandleToObject("[Handle]")

spos = aec.ActiveDocument.Utility.ConvertToVariantArray(obj.PointAtParam(0))
RESULT = FormatNumber(spos(2) - (obj.InnerHeight / 2), 3)




Start Invert : 

RESULT = "--"
On Error Resume Next
Set oApp = GetObject(, "AutoCAD.Application")
Set oCivilApp = oApp.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication.13.6")
Set aec = oApp.GetInterfaceObject("AecX.AecBaseApplication.8.6")
aec.Init oApp
Set obj = oCivilApp.ActiveDocument.HandleToObject("[Handle]")

spos = aec.ActiveDocument.Utility.ConvertToVariantArray(obj.PointAtParam(1))	
RESULT = FormatNumber(spos(2) - (obj.InnerHeight / 2), 3)



Thanx again folks to helping someone out - I let the code here for someone else to use in the futur.


Usefull link : 
http://docs.autodesk.com/CIV3D/2013/ENU/API_Reference_Guide/html/73fd1950-ee31-00b8-4872-c3f328ea133...


Frank Freitas

CAE/CAD/BIM Coordinator & Support Specialist

LinkedIn
0 Likes