How to reconnect all components in a drawing with API ?

How to reconnect all components in a drawing with API ?

traiduong014969
Collaborator Collaborator
556 Views
4 Replies
Message 1 of 5

How to reconnect all components in a drawing with API ?

traiduong014969
Collaborator
Collaborator

Hi all,

Recently, I have an issue I want to ask about. Specifically:

In my drawing, I have pipeline segments of the same size, and when I copy them, disconnection markers appear. I have to use the `PLANTCONNECTJOINT` command to reconnect them, but it takes a lot of time. I have the idea to use the API to make this process faster, but I haven't found any related code. If anyone has successfully done this before, could you please share some code or make a suggestion to help me out?

Thank you!

traiduong014969_0-1722587087457.png

 

 
 
0 Likes
Accepted solutions (1)
557 Views
4 Replies
Replies (4)
Message 2 of 5

quan_hm
Collaborator
Collaborator
Accepted solution

Hi,

Why dont you check this sample from SDK

quan_hm_0-1722743314471.png

Looking for ConnectParts function and how it was used

quan_hm_1-1722743349971.png

You may need to loop through all the part to find the port need to connect

Hoang Minh Quan - Piping design engineer
Autodesk Store for Python Catalog
Message 3 of 5

traiduong014969
Collaborator
Collaborator

Thank you for your suggestion. I combined some of your code with my own ideas, and now it works perfectly😊

 
0 Likes
Message 4 of 5

support4ENZ4
Observer
Observer

deleted

0 Likes
Message 5 of 5

quan_hm
Collaborator
Collaborator

you're welcome :))

Hoang Minh Quan - Piping design engineer
Autodesk Store for Python Catalog
0 Likes