Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Expose Tube & / and Pipe Style for a Route

Expose Tube & / and Pipe Style for a Route

All,

 

I would like to be able to access the style for a given route in Tube & Pipe for some programming purposes.  Currently it doesn't look like much of the API for Tube & Pipe is available, so I'd like that to happen or for the Active style of a Route to be exposed as a property (custom iProperty, even) that could be read and utilized to populate downstream operations, such as adding fasteners to flanged pipe connections.  Hopefully this makes sense, but please let me know and I can try to elaborate in the comments below.  Thanks for your consideration and have a most blessed day!

 

Peace,

Pete

1 Comment
A.Acheson
Mentor

To workaround  the lack of access to styles API here is a forum post link to change route styles in and assembly. Hopefully you can modify as needed. 

 

Here is a rule to get the full list of styles thanks to @Tom_Fuller and to get the active style in a route. 

	Dim oDoc As Document = ThisDoc.Document

	Dim oCDs As ControlDefinitions = ThisApplication.CommandManager.ControlDefinitions 
		
	'Active Style (Combo Box Tube and Pipe Styles).
	Dim oCD As ControlDefinition = oCDs("HSL:Piping:StylesComboBox")

	'Cast to ComboBoxDefinition.
	Dim oComboBoxDef As ComboBoxDefinition = DirectCast(oCD, ComboBoxDefinition)
	
	'Create a New List.
	Dim StyleList As New List(Of String) 

	For i = 1 To oComboBoxDef.ListCount
		StyleList.Add(oComboBoxDef.ListItem(i))
	Next
	
	Dim StyleName As String  = InputListBox("Prompt", StyleList, d0, Title := "Title", ListName := "List")

	MessageBox.Show(oComboBoxDef.ToolTipText, "Active style when in the Route")

 

 

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

Submit Idea  

Autodesk Design & Make Report