User Work Plane Labels

User Work Plane Labels

ASchlaack
Collaborator Collaborator
2,107 Views
14 Replies
Message 1 of 15

User Work Plane Labels

ASchlaack
Collaborator
Collaborator

I have work planes in a part that I have named, when I place the part I go to the Display Options tab and click include all user work features so it will bring all of my planes in. Is there a way to have it auto name the planes according to their name in the model? I just want an easier quicker way of naming each one on large models with quite a few planes that I have to bring over.

 

It doesn't matter if it's through iLogic or just a random command to do this, whatever can work will work for me just fine. 

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Accepted solutions (1)
2,108 Views
14 Replies
Replies (14)
Message 2 of 15

xiaodong_liang
Autodesk Support
Autodesk Support
Hi Aaron ,

could you provide the demo files to help me to understand the requirement? In addition, when you said 'Display Options tab and click include all user work features', do you actually mean 'View tab >> Visibility >> Object Visibility ' ? if not, could you also attach a screenshot? Thank you!
0 Likes
Message 3 of 15

ASchlaack
Collaborator
Collaborator
Thanks for your reply! I will get those files to you tomorrow, I'm not
going to be at work today. Again, thanks
Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 4 of 15

ASchlaack
Collaborator
Collaborator

Thanks for your reply and sorry it took me till today to reply.

 

So for the include user work planes, this is what I meant, it's in the window when you place a view:

 

User Work Features.PNG

 

To start, my part looks like this for an easy example, the planes are all named:

 

3D Part.PNG

 

And by turning on the user planes and placing a view it looks like this (the red lines are all of my workplanes I created):

 

Unnamed View.PNG

 

But what I want is for it to somehow pull the names of each plane from the part itself and look like this:

 

View With Names.PNG

 

I went ahead and attached a dropbox link to a folder with my part I used here if you want it:

 

https://www.dropbox.com/sh/tszahij7dvqsyhm/AAA8iO7OOpIVimrXURjW9V2xa?dl=0

 

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 5 of 15

Curtis_Waguespack
Consultant
Consultant

just a quick link to the other thread in case it helps somone from duplicating efforts:

http://forums.autodesk.com/t5/inventor-general-discussion/user-work-plane-naming/td-p/5560524

EESignature

0 Likes
Message 6 of 15

Curtis_Waguespack
Consultant
Consultant

HiASchlaack,

I had this code on hand and thought I would post it in case it helps someone work up a solution.

 

This code is run from a drawing and looks at the model reference (it assumes only one model is referenced in the drawing), and then it displays the names of all of the user workplanes.

 

I think what you would want to add to this are these things:

  • Code to look at a specific drawing view (likely the view selected by the user)
  • Code to create a sketch associated to that view
  • Code to find the co-ordinates of the planes? or some other means for the placement of the sketch
  • Code to write the plane names to text in the sketch and place it at some co-ordinates.

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

 

 

 

Dim oPartDoc As PartDocument
oPartDoc = ThisDoc.ModelDocument

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
	'skip origin planes
    	If oWorkPlane.IsCoordinateSystemElement = True Then
    	'do nothing 
    	Else
	oSelectSet.Select(oWorkPlane)
	MessageBox.Show(oWorkPlane.Name, "iLogic")
	End If
oSelectSet.Clear 
Next

 

EESignature

Message 7 of 15

ASchlaack
Collaborator
Collaborator

Thanks for that code! and If anyone else can build off of it that'd be very much appreciated!

 

Curtis, that's a really cool but yet odd code to just have on hand. So I'm just curious when you've used that code in a parctical way?

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 8 of 15

Curtis_Waguespack
Consultant
Consultant

Hi ASchlaack,

 

Technically I didn't have that exact code on hand, I had a snippet to iterate through all of the workplanes in a model and then turn their visibility off. I simply:

  • replaced the visibility line with the message box
  • replaced the line that looked directly at the model, to make it look at the drawing's referenced model

I wish I had time to dig into the rest of what you're after, but unfortunately I don't see that happening any time soon.

 

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

EESignature

0 Likes
Message 9 of 15

xiaodong_liang
Autodesk Support
Autodesk Support
Accepted solution
Message 10 of 15

ASchlaack
Collaborator
Collaborator

Yes that does, thank you!

 

But...

What do I put into the first line of code?

 

Capture.PNG

 

*** I got rid of the first and last line of each code and it now works. Is that an ok solution?

Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 11 of 15

xiaodong_liang
Autodesk Support
Autodesk Support
In default, the codes you write in iLogic is within a subroutine called 'main' . If you have other functions (subroutine), you must explicitly define the 'main' subroutine .

So, either you put the code body of my demo function to the iLogic window directly, removing the first line and the last line of my demo, e.g.

iLogic Window
'********
Dim oDoc As DrawingDocument
....
....

'********

Or, define the 'main' subroutine and copy my demo as another subroutine, say

iLogic Window
'********
Sub Main()
addDrawingNoteForWorkPlane()
End Sub

Sub addDrawingNoteForWorkPlane()
'.....
End Sub


'********

0 Likes
Message 12 of 15

ASchlaack
Collaborator
Collaborator
That's awesome, I have one last thing I'd like to see if you could do for me if you've got a second. On our drawings all of these work planes represent pillar and colom lines in buidlings. For the "vertical" plane in the model and print you used in your blog, I would like for that value to show up in a ballon. Is this possible?
Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 13 of 15

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

you just need to create balloon with the leader points the geometry intent. Please refer to a demo code in API help reference at

C:\Program Files\Autodesk\Inventor <version>\Local Help\admapi_<version>.chm

 

the code sample is [Creation a balloon API Sample  ]

 

it is not exactly for your scenario, but you could just borrow some code lines and merge to the demo I created.

 

0 Likes
Message 14 of 15

ASchlaack
Collaborator
Collaborator
I have got no clue how to combine these codes.
Thanks,
Aaron Schlaack
---------------------------------------------------------------------------------
Autodesk Inventor 2018
Dell Windows 8.1 64 bit Intel(R) Xeon(R) @ 3.50GHz 32GB Ram
0 Likes
Message 15 of 15

xiaodong_liang
Autodesk Support
Autodesk Support
Hi Aaron,

Sorry, I think I made a mistake. Balloon works only for the drawing curve from the component of an assembly. For a centerline or curve of part, it does not make sense to bind a balloon.
probably you could attach a sketched symbol, while it is a challenge to have sketched symbol with different text string, instead of creating specific symbol one by one.
sorry for not being much help.
0 Likes