Create a Rectangle on sketch using iLogic

Create a Rectangle on sketch using iLogic

Anonymous
Not applicable
1,837 Views
1 Reply
Message 1 of 2

Create a Rectangle on sketch using iLogic

Anonymous
Not applicable

Greetings,

I have an application where I will be creating the same rectangular extrusion on many different parts but not always on the same plane. I would like to automate this process using iLogic. So far, I manually create a plane in Autodesk Inventor and name it "ButtonPlane" and then run the rule shown below.

 

oDef = ThisDoc.Document.ComponentDefinition

Dim oWPlane As WorkPlane
oWPlane = oDef.WorkPlanes.Item("ButtonPlane")
	
oSketch = oDef.Sketches.Add(oWPlane)

 This successfully creates a sketch on the ButtonPlane, but I am not able to complete the remainder of the task. What do I need to add to this code in order to create a rectangular extrusion of lets say of 10 mm x 20 mm (in sketch dimensions) and then extrude it by 30 mm?

0 Likes
Accepted solutions (1)
1,838 Views
1 Reply
Reply (1)
Message 2 of 2

Scott_Parker
Autodesk
Autodesk
Accepted solution

There is a site called Mod the Machine that gives some great Inventor API support.  Specifically for what you are looking for try: https://modthemachine.typepad.com/my_weblog/2012/04/drawing-in-a-sketch.html.  Besides sample code it will give some explanation that will help.



Scott Parker
Principal Software Engineer