Inventor General Discussion

Inventor General Discussion

Reply
Distinguished Contributor
slphantom
Posts: 203
Registered: ‎07-20-2007
Message 1 of 5 (366 Views)
Accepted Solution

auto project datum planes

366 Views, 4 Replies
07-13-2012 12:38 PM

is there a way to auto project datum planes that are square to the sketch?

just wondering.

thanks

Scott
win 7 64 bit sp1
cpu intel xeon E5-2687W0@3.106
eight core
two solid state hard drives
32 gig of ram
Autodesk product design
suite premuim 2014 64bit
Nvida quadro 4000
Space Pilot ver. 1.6.2 2010
slphantom (NNTP handle: scottl)
You may recognize me from the
hundreds of previous newsreader posts
I've made over the last 5 years
as scottl

Hi slphantom,

 

Attached is an example file with an iLogic rule in it that might work for you. If you create an external iLogic rule with this code you'll have it available to run on any file.

 

Note that you need to be in a sketch edit for the rule to work.

 

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
'Do nothing
Else
MessageBox.Show("Activate a Sketch First then Run this Rule", "ilogic")
Return
End If
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oSelectSet As SelectSet
oSelectSet = oPartDoc.SelectSet
oSelectSet.Clear
'look at the workplane collection
'and add each workplane to the select set
For Each oWorkPlane In oPartDoc.ComponentDefinition.WorkPlanes
oSelectSet.Select(oWorkPlane)
Next
'Project Geometry
ThisApplication.CommandManager.ControlDefinitions.Item("AppProjectGeometryWrapperCmd").Execute
'Cancels active command
ThisApplication.CommandManager.StopActiveCommand

 

*Expert Elite*
cwhetten
Posts: 1,090
Registered: ‎09-03-2008
Message 2 of 5 (359 Views)

Re: auto project datum planes

07-13-2012 01:14 PM in reply to: slphantom

I wish there was, since this is my preferred method of constraining to the part origin.  Instead, I had to create part templates with the first sketch having the projected planes, one template each for sketching on the XY, XZ, & YZ planes (see attached).  I put the 0 in front of each template name so that they show up first in the list of templates.

*Expert Elite*
Curtis_Waguespack
Posts: 3,000
Registered: ‎03-08-2006
Message 3 of 5 (341 Views)

iLogic Project All Work Planes

07-13-2012 02:35 PM in reply to: slphantom

Hi slphantom,

 

Attached is an example file with an iLogic rule in it that might work for you. If you create an external iLogic rule with this code you'll have it available to run on any file.

 

Note that you need to be in a sketch edit for the rule to work.

 

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
'Do nothing
Else
MessageBox.Show("Activate a Sketch First then Run this Rule", "ilogic")
Return
End If

Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

Dim oSelectSet As SelectSet 
oSelectSet = oPartDoc.SelectSet
oSelectSet.Clear 

'look at the workplane collection 
'and add each workplane to the select set
For Each oWorkPlane In oPartDoc.ComponentDefinition.WorkPlanes
oSelectSet.Select(oWorkPlane)
Next

'Project Geometry
ThisApplication.CommandManager.ControlDefinitions.Item("AppProjectGeometryWrapperCmd").Execute
'Cancels active command
ThisApplication.CommandManager.StopActiveCommand

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





*Expert Elite*
Curtis_Waguespack
Posts: 3,000
Registered: ‎03-08-2006
Message 4 of 5 (333 Views)

Re: iLogic Project All Work Planes

07-13-2012 02:57 PM in reply to: Curtis_Waguespack

Here's another version that only projects Origin Planes.

 

If Typeof ThisApplication.ActiveEditObject Is Sketch Then
'Do nothing
Else
MessageBox.Show("Activate a Sketch First then Run this Rule", "ilogic")
Return
End If

Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

Dim oSelectSet As SelectSet 
oSelectSet = oPartDoc.SelectSet
oSelectSet.Clear 

'look at the workplane collection 
For Each oWorkPlane In oPartDoc.ComponentDefinition.WorkPlanes
'find origin planes only
If oWorkPlane.IsCoordinateSystemElement = True Then 
oSelectSet.Select(oWorkPlane)
End If
Next

'Project Geometry
ThisApplication.CommandManager.ControlDefinitions.Item("AppProjectGeometryWrapperCmd").Execute
'Cancels active command
ThisApplication.CommandManager.StopActiveCommand

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Contributor
z.baczo
Posts: 21
Registered: ‎08-31-2012
Message 5 of 5 (198 Views)

Re: iLogic Project All Work Planes

02-28-2013 11:56 PM in reply to: Curtis_Waguespack

Hi,

 

Sorry for bringing back to life an older thread but I'm also interested in this functionality.

 

What i'm interested in is: Is there a way to create a button on the ribbon (or a shortcut key) for this?
Maybe a macro or something? (I'm not very familiar with macros, not sure if it would be possible or not...).

 

Thanks in advance,

B.

 

(Inventor 2013).

Baczó.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.