- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
For the following python script . . .
I search many times, many ways, but NOT found . . .
Where the document is placed?
for example:
trans.setCell
root.occurrences.addExistingComponent(newComp, trans)
Matrix3D
rotX.setToRotation
the_Occ.transform
trans_data.transformBy( )
When I search Autodesk relevant web site/forums.
What I found just sample codes usage example. No original documents.
I can not find trans.setCell it's usage format, explain, etc.
So, Is there any document that I can use???
# code example:
#+++++++++++++++++++++++++++++++++++++++++++++++++++++
root = app.activeProduct.rootComponent
trans = adsk.core.Matrix3D.create()
occ = root.occurrences.addNewComponent(trans)
newComp = occ.component
#
trans.setCell(0,3,tx) # translat tx in the X direction
trans.setCell(1,3,ty) # translat ty in the Y direction
trans.setCell(2,3,tz) # translat tz in the Z direction
new_Occ = root.occurrences.addExistingComponent(newComp, trans)
#
rot_radian = 1*np.pi/3 # 弳度(弧度)
rot_about_Z_axis = adsk.core.Vector3D.create(0,0,1)
rot_center_xyz = adsk.core.Point3D.create(0,0,0)
rotX = adsk.core.Matrix3D.create()
rotX.setToRotation(rot_radian, rot_about_Z_axis, rot_center_xyz)
#
# Create a new occurrence for the component
the_Occ = root.occurrences.addExistingComponent(newComp, trans)
# Get the current transform data
trans_data = the_Occ.transform
trans_data.transformBy(rotX)
# Set the tranform data back to the occurrence
the_Occ.transform = trans_data
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Solved! Go to Solution.