AnsweredAssumed Answered

InsertRefPlane help

Question asked by Alfred Jelinek on May 1, 2016
Latest reply on May 2, 2016 by Alfred Jelinek

Hello All, thank you for taking the time to possibly help with this...

 

I am creating a macro that sets up an assembly with subassemblies for designing stamping dies.

 

One plane I would like to create in a subassembly is a feed height plane that would help define the assembly.

 

I have tried to fiddle around with setting in a macro I recorded to try and learn more about the settings, but I cannot seem to figure out where the user defined 10.5, 11.0, or 12...etc inch distance is in the command options.

 

I have looked around on the forums and the API help for VBA code to aid in helping me figure out what each is...

 

example:

 

'add feed height plane

boolstatus = Part.Extension.SelectByID2(JobNumber.Text + "-Lower_Die_Assy-1@" + JobNumber.Text + "-Main_Die_Assy", "COMPONENT", 0, 0, 0, False, 0, Nothing, 0)

Part.EditAssembly

Part.ClearSelection2 True

boolstatus = Part.Extension.SelectByID2("Top Plane@" + JobNumber.Text + "-Lower_Die_Assy-1@" + JobNumber.Text + "-Main_Die_Assy", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

Dim myRefPlane As Object

Set myRefPlane = Part.FeatureManager.InsertRefPlane(8, 0.2286, 0, 0, 0, 0)

Part.ClearSelection2 True

boolstatus = Part.Extension.SelectByID2("PLANE1@" + JobNumber.Text + "-Lower_Die_Assy-1@" + JobNumber.Text + "-Main_Die_Assy", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

boolstatus = Part.Extension.SelectByID2("PLANE1@" + JobNumber.Text + "-Lower_Die_Assy-1@" + JobNumber.Text + "-Main_Die_Assy", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

boolstatus = Part.Extension.SelectByID2("PLANE1@" + JobNumber.Text + "-Lower_Die_Assy-1@" + JobNumber.Text + "-Main_Die_Assy", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

boolstatus = Part.Extension.SelectByID2("PLANE1@" + JobNumber.Text + "-Lower_Die_Assy-1@" + JobNumber.Text + "-Main_Die_Assy", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

Part.ActivateSelectedFeature

boolstatus = Part.Extension.SelectByID2("PLANE1@" + JobNumber.Text + "-Lower_Die_Assy-1@" + JobNumber.Text + "-Main_Die_Assy", "PLANE", 0, 0, 0, False, 0, Nothing, 0)

boolstatus = Part.SelectedFeatureProperties(0, 0, 0, 0, 0, 0, 0, 1, 0, "FEED HEIGHT")

Part.EditAssembly

Part.ClearSelection2 True

 

 

It creates the plane and renames it to "@Feed Height"

 

but I would like to create a user input box(textbox) where I...or a user can define the shut height plane distance in inches then once hitting a button it creates the plane at that distance...

 

however.. I cannot find the info that tells me what all this "Set myRefPlane = Part.FeatureManager.InsertRefPlane(8, 0.2286, 0, 0, 0, 0)" defines as I assume that this is the line that defines and inserts the plane....the (8, 0.2286, 0, 0, 0, 0) can't find info anywhere.

 

Would also like to create an additional macro to then be able to edit that plane distance with a user prompt....change feed height macro...

 

Thanks for you help!

 

Al Jelinek

Outcomes