How do you create a new Workplane from a Defualt Plane and rotate it along a default Axis?
I am new to API and trying to create workplanes and rotate them along a Axis.
Im trying to use "AddByPlaneAndOffset" is this the right method?
Hi
No, AddByPlaneAndOffset allows only a plane parallel to the source plane. Use SetByLinePlaneAndAngle instead.
ok i have it working, but my angle isnt coming out right. how do i set the angle as a Object?
Hi
Sorry, couldn't provide the example at work. Now at home I'm too late.
The angle, if provided as numeric value without dimension is interpreted as radiant !
From developers help:
thank you for responding, i think i understand what you are saying heres my code for a more visual.
Dim oPartDoc As PartDocument
Dim oPartCompDef As PartComponentDefinition
Dim BaseXY As WorkPlane
Dim AxisX As WorkAxis
Dim oANG1 As Double
oPartDoc = oApp.ActiveDocument
oPartCompDef = oPartDoc.ComponentDefinition
BaseXY = oPartCompDef.WorkPlanes.Item(3)
AxisX = oPartCompDef.WorkAxes.Item(1)
oANG1 = "30"
oPartCompDef.WorkPlanes.AddByLinePlaneAndAngle(AxisX, BaseXY, oANG1)
what am i doing wrong my workplane ends up being a 2.xxxxxxx deg angle???
Hello
Try
Dim oANG1 As String oANG1 = "30 grd"
Your code means an angle of 30 radiant = 1718,8733853925°.
Thank you so much its working great now.
can you explain what the "grd" means ?
Hi
"grd" means just grad or degrees or ° and is the unit of angle value. Take a look at your fx-Parameters after creating your workplane and the new parameter for the angle.
Can't find what you're looking for? Ask the community or share your knowledge.