Automatic sketch projection of perpendicular planes: Can iLogic do that?

Automatic sketch projection of perpendicular planes: Can iLogic do that?

jeffg28CLY
Collaborator Collaborator
261 Views
2 Replies
Message 1 of 3

Automatic sketch projection of perpendicular planes: Can iLogic do that?

jeffg28CLY
Collaborator
Collaborator

In almost every part sketch I do, I have to either:

- Expand the Origin, find the two planes I'm not sketching on, and Project-Geometry to use them as sketch references. This is by far the most common workflow.

- If I'm not sketching on an origin plane, find and Project planes that are perpendicular to the sketch.

 

What I'd like is to have Inventor automatically:

1) Try to find two origin planes that are perpendicular to the sketch view I'm in, and project them.

2) If two origin planes are not perpendicular to the sketch view, find any other planes that are perpendicular and project any that can be projected.

 

I'd like for it to do this whenever a new sketch is made, automatically and without any prompts or extra clicks.

 

Can that be done using iLogic?

 

0 Likes
262 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant

Hi @jeffg28CLY 

 

You can use this code in a rule when in a sketch, and it will project the perpendicular planes.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

If TypeOf ThisApplication.ActiveEditObject Is Sketch Then
	oSketch = ThisApplication.ActiveEditObject
	For i = 1 To 3
		oWp = ThisApplication.ActiveDocument.ComponentDefinition.Workplanes.item(i)
		Try : sEntity = oSketch.AddByProjectingEntity(oWp) : Catch : End Try
	Next
End If

 

EESignature

0 Likes
Message 3 of 3

jeffg28CLY
Collaborator
Collaborator

Thank you.

 

I added it to the iLogic section for my standard.ipt file, started a new Part, and tried a sketch.

Nothing projected though.

It looks like I have to go there, right-click it, and select Run Rule. Then it projects some things.

 

Can iLogic be used to make it to run automatically as soon as a new sketch is made? Or does iLogic stuff only run when "Run Rule" is clicked?

If so, I wasn't necessarily expecting anyone here to write me some code; I've got someone here who knows this sort of coding and I'm hoping will be able to have time to learn Inventor's implementation of it.

 

Edit: I tried this:

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/automatically-run-ilogic-rule-upon-o...

In my standard.ipt file, I added the rule under the "New Document" and "After Open Document" sections in the Rules on Events" section, but that didn't get it. I guess it needs to be run/triggered specifically right when a sketch is started?

0 Likes