How to add Multiple nozzle into equipment with python script

How to add Multiple nozzle into equipment with python script

traiduong014969
Collaborator Collaborator
871 Views
9 Replies
Message 1 of 10

How to add Multiple nozzle into equipment with python script

traiduong014969
Collaborator
Collaborator

Hi all, recently I have created equipment with python. I successfully with creating equipment with nozzle fixed. However, when I create any nozzle such as a tank, or vessel. It appears as a snapshot below. Someone can help me fix that.

As always thank you for your time and consideration. Have a GREAT day! 

traiduong014969_0-1655345228586.png

traiduong014969_1-1655345346924.pngtraiduong014969_2-1655345442781.png

 

 

0 Likes
872 Views
9 Replies
Replies (9)
Message 2 of 10

rajendra.prajapat
Advisor
Advisor

@traiduong014969 Please try below lines

 

<Nozzles>
<NozzleInfo Name="Nozzle 1" PortIndex="1">
<DisplayName>Nozzle 1</DisplayName>
<NozzleTypes />
<Parameters>
<ParameterInfo Name="LOC" DefaultValue="1" Type="List" />
<ParameterInfo Name="R" DefaultValue="0" Type="d0" />
<ParameterInfo Name="A" DefaultValue="0" Type="a" />
<ParameterInfo Name="L" DefaultValue="3" Type="d" />
</Parameters>
<PortProperties>
<PropertyInfo Name=".SizeRecordId" DefaultValue="4b77a031-115e-53ce-affc-6aa39b8177f1" />
</PortProperties>
</NozzleInfo>
<NozzleInfo Name="Nozzle 2" PortIndex="2">
<DisplayName>Nozzle 2</DisplayName>
<NozzleTypes />
<Parameters>
<ParameterInfo Name="LOC" DefaultValue="2" Type="List" />
<ParameterInfo Name="H" DefaultValue="45" Type="d-" />
<ParameterInfo Name="A" DefaultValue="0" Type="a" />
<ParameterInfo Name="L" DefaultValue="3" Type="d" />
</Parameters>
<PortProperties>
<PropertyInfo Name=".SizeRecordId" DefaultValue="4b77a031-115e-53ce-affc-6aa39b8177f1" />
</PortProperties>
</NozzleInfo>
</Nozzles>

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes
Message 3 of 10

traiduong014969
Collaborator
Collaborator

Yes, I'm tried add your code, but it not working. You can see picture below:

traiduong014969_0-1655354358867.png

This is my code

 

0 Likes
Message 4 of 10

rajendra.prajapat
Advisor
Advisor

@traiduong014969 please do not use the same GUID.

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes
Message 5 of 10

traiduong014969
Collaborator
Collaborator

yes, follow your guide, I replaced GUID. it appears a message warning and then I click ok, equipment insert is a tank that has torispherheads . actually, in my code, I only insert a cylinder. and then i don't  create an new when-click button to make an equipment

0 Likes
Message 6 of 10

rajendra.prajapat
Advisor
Advisor

@traiduong014969 please attached the equipment package here.

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes
Message 7 of 10

traiduong014969
Collaborator
Collaborator

this is my code when i update GUID

0 Likes
Message 8 of 10

rajendra.prajapat
Advisor
Advisor

@traiduong014969 you need to define the used equipment parameter in python script  inside the equipment xml file.

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes
Message 9 of 10

traiduong014969
Collaborator
Collaborator
you can share an example code for me, please
0 Likes
Message 10 of 10

rajendra.prajapat
Advisor
Advisor

@traiduong014969 

 

<PartProperties>
<PropertyInfo Name="PartSizeLongDesc" DefaultValue="Electrical Panel" />
</PartProperties>
<Categories>
<CategoryInfo Name="EPANEL">
<Parameters>
<ParameterInfo Name="D" DefaultValue="500" />
<ParameterInfo Name="W" DefaultValue="250" />
<ParameterInfo Name="H" DefaultValue="1000" />
</Parameters>
</CategoryInfo>
</Categories>

 

script code

def EPANEL(s, D = 500.0, W = 250.0, H = 1000.0, ID = 'EPANEL', **kw):
a1 = EQBOX(s, D = D, W = W, H = H)
s.setPoint((0, 0, 0), (0, 0, -1))
s.setPoint((0, 0, H), (0, 0, 1))

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes