How to draw a nut with python script in Plant3D,

How to draw a nut with python script in Plant3D,

228722682
Contributor Contributor
1,214 Views
2 Replies
Message 1 of 3

How to draw a nut with python script in Plant3D,

228722682
Contributor
Contributor

I want to add a nut to Shut-off Valve

0 Likes
1,215 Views
2 Replies
Replies (2)
Message 2 of 3

ZZikic
Advocate
Advocate

Bolt and nut scripts are included in the Plant 3D supplied variants.zip under the ...\varmain\divsub\… location and can be called into any Python script as follows:

 

At the top of your script add the highlighted 2 lines.

 

# Import Python Packages
from aqa.math import *
from varmain.divsub.cbolt6_001 import *
from varmain.divsub.cnut6_001 import *
from varmain.primitiv import *
from varmain.var_basic import *
from varmain.custom import *

 

Then later in your script, after the metadata section and def command:

 

o1 = NUT_BOLT_HEAD_6_001(s, W=MW, H=MH).rotateY(90.0).translate((0.0, 0.0, 0.0))

o2 = CNUT6_001(s, D=W, W=MW, H=MH).rotateY(90.0).translate((0.0, 0.0, 0.0))

 

Where D = bolt diameter, W = dimension across flats, H = Bolt/nut height.  They will be bottom center justified pointing up in the positive Z direction so you will likely need to rotate and translate as needed.

 

 

0 Likes
Message 3 of 3

ing_hcjp
Contributor
Contributor

HELLO FRIEND,
DID YOU SOLVE IT? I HAVE THE SAME QUESTION. GREETINGS
COULD YOU HELP ME?

0 Likes