Reference solid body name in balloon text?

Reference solid body name in balloon text?

rogmitch
Advocate Advocate
3,381 Views
19 Replies
Message 1 of 20

Reference solid body name in balloon text?

rogmitch
Advocate
Advocate

My preferred methodology is to push out multibody solids to parts/assemblies as late as possible in the design process.  It would, however, be very helpful to be able to balloon multibody parts with the name of each solid. prior to creating the assembly.

 

I can code the ballooning part to reference standard/custom  properties but does anyone know if I can reference the name of a solid body in the balloon text?

 

Any help much appreciated

 

Roger Mitchell

 

IV 2018 Prof.  2018.2.3

0 Likes
Accepted solutions (1)
3,382 Views
19 Replies
Replies (19)
Message 2 of 20

MechMachineMan
Advisor
Advisor

Are you talking about ballooning the part AFTER it's been pushed out, with the name from the multi body file?

 

If so, I would ask: Why not just use code to push the solid body name into the separated .ipt files so it is there already?


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 20

rogmitch
Advocate
Advocate

No, I would like to balloon before pushing out.  Afterwards I have all the individual part file names so it is not a problem.  

 

It's just that if you push out too early and then keep on modifying the multibody (some with 100+ solids) it is more difficult to manage as you end up with stray files, name changes etc as the model progresses..

 

My guess is the solid body name is probably not accessible via the drawing environment but hovering over/selecting a solid body in the drawing browser does highlight the solid in the drawing,  so I will  keep my fingers crossed for a future tweak to the API -that and for individual materials for solid bodies in the part environment  which would be also be really useful.

 

Thanks,

 

Roger

0 Likes
Message 4 of 20

MechMachineMan
Advisor
Advisor

So you are wanting to override balloons of a drawing of a multibody part to show the solid body name?

Sounds like you do probably need a macro/rule to do that.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 5 of 20

rogmitch
Advocate
Advocate

Correct, but I cannot find a way to access the SurfaceBody name under the balloon object.

 

0 Likes
Message 6 of 20

MechMachineMan
Advisor
Advisor

Have you used the vba object explore to "test" the balloon object to see if the data about the geometry linked to the balloon shows anything?

 

If you have, and can't find anything, you might be SOL.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 7 of 20

rogmitch
Advocate
Advocate

Yes, I looked and no luck.  I guess SOL is about right!

 

Thanks anyway

 

Roger Mitchell

0 Likes
Message 8 of 20

NachoShaw
Advisor
Advisor
I don't understand. Are you putting the multibody part into a drawing? If so, why? That's not productive

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 9 of 20

rogmitch
Advocate
Advocate

I don't understand why you think it is not productive.  If you could balloon the individual solids how could you tell it was not a drawing of a normal assembly?

0 Likes
Message 10 of 20

NachoShaw
Advisor
Advisor
It's not productive because a multibody part is only to create the individual parts in an assembly. It's the only and correct method to list parts as they should be. The multibody purpose is to drive the assembly. Materials and appearances should be at part level not multibody level.


You should read up on how to do this properly.

Solidworks work your way but it's not the right way.

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 11 of 20

rogmitch
Advocate
Advocate

I agree with you that assemblies are at the only way to go at the moment for part listing- I do this,  as I do not have a choice .  However, in my opinion multibody modelling is by far the best and most intuitive method for modelling static structures (mine run into 1000's of parts) but the tools available in IV could be significantly improved.  Sticking individual lumps together with constraints is not a good way to design !

Message 12 of 20

NachoShaw
Advisor
Advisor
Of course it's a good way to design, that's the purpose. You cannot have individual parts if you use the multibody as your model, it doesnt work that way.

If I was working on a large assembly with many many parts, I would create a master BM and in that would be the basic shapes of smaller BMs. I would then model each BM and send the parts into an assembly using the make component tool. All of the parts are positioned relative so, you wouldn't be manually constraining anything. All of the sub assemblies can be added to the master assembly and positioned by using Ground and Root.

Your method is the Solidworks method. I suspect that you have come from that and think it works the same way but it doesn't.

I n real life, a real assembly is a collection of separate parts assembled together. Your assemblies should also reflect this instead of a single part holding multiple bodies that will end up being complicated when it comes to parts.

Let me ask. When you put the multibody into your drawing, how do you show individual parts on drawing sheets? Are you using multiple versions of the MB and hiding certain solid bodies to get specific parts?

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 13 of 20

rogmitch
Advocate
Advocate

I understand your point of view and I know how IV works but I still think there are better methodologies.  I am not from a SolidWorks stable but started with IV R5 and have tried every which way to model- top up, down and sideways!

 

Your point that a real assembly is a collection of parts is, of course, accurate but a multibody part is also just a container of 'real parts'. They just don't exist yet!  If solids could contain physical information then assemblies would be (almost) redundant for static systems apart for the need to collect sub-assemblies and add library components.

 

Your description of a workflow is essentially what I use.  I create MB sub-assemblies which are then held in an overall master assembly.  The master assembly remains light and easy to manipulate because there are relatively few  constrained parts to worry about-just content centre and standard components. 

 

Most of our design is bespoke and so needs lots of iteration and occasionally complete reversals in concept.  For this reason I do not wish to push the parts out for manufacture (make components)  until the latter stages as I can end up with lots of redundancy that needs to be managed. 

 

However,  for example the ability to do a quick ballooned drawing of a MB sub-assembly which I can discuss with our technicians would be helpful- the reason for my original post. Drawings of individual parts ultimately need the parts to be derived out and drawn in the conventional way as per non-derived parts.

 

 

0 Likes
Message 14 of 20

NachoShaw
Advisor
Advisor
The only thing i would say about that is while you maintain a multibody assembly, you are unable to use other information like materials, appearances, physical weights, iproperties etc. The ONLY element you will be able to maintain is the name of the solid body... Personally, I wouldn't want that many features in my BM as they tend to slow down.

I'm not sure whether what you want is achievable in code because inventor doesn't work this way so they don't include any methods of achieving it. You could try and identify what solid you have selected in the drawing and then match it with the selected object in the browser to get the solid name?

An automatic balloon method could follow and add the balloon on the point that you clicked to select the body in the drawing. Of course, you will need to use a select method to get the solid and also the selection point (which would be the mouse event). You won't be able to have the 2 point positioning (rubber band effect) because the api doesn't provide it I'm afraid

Nacho

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 15 of 20

MechMachineMan
Advisor
Advisor

It's possible... You need to brush up on your debugger using skills....

 

 

Balloon > Leader > Root Node > Child nodes > Item 1 > Attached Entity > geometry > model geometry > surface body > Name.....

 

 

If I can get there that way, there's likely more direct ways too.....


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 16 of 20

MechMachineMan
Advisor
Advisor
Accepted solution
Select Balloon... Run code... Watch Balloon get revalued to be the solid name.

 

 

Sub Main()
	Dim oSS As SelectSet
	oSS = ThisApplication.ActiveDocument.SelectSet
	
	oSS.Item(1).BalloonValueSets.Item(1).OverrideValue = GetSolidName(oSS.Item(1))
	
End Sub

Function GetSolidName(oBalloon As Balloon) As String
	Dim oLeader As Leader
	oLeader = oBalloon.Leader
	
	Dim oNode As LeaderNode
	Dim oModelGeom
	For Each oNode In oLeader.AllNodes
		If Not (oNode.AttachedEntity Is Nothing)
			oModelGeom = oNode.AttachedEntity.Geometry.ModelGeometry
			Exit For
		End If
	Next
	
	If oModelGeom.Type = ObjectTypeEnum.kEdgeObject
		oSurfaceBody = oModelGeom.Faces.Item(1).SurfaceBody
	Else
		oSurfaceBody = oModelGeom.SurfaceBody
	End If
	
	GetSolidName = oSurfaceBody.Name
End Function  

 

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 17 of 20

rogmitch
Advocate
Advocate

Thanks Justin- that's brilliant. 

 

You are correct, I need to brush up on my local window mapping.  I really didn't spot that path to the Surfacebody.

I tweaked your code to get in running in VBA as that is all I have on this machine.  I didn't see how you could get the oModelGeom to support Surfacebody as a property but it works via oModelGeom.Faces...

 

I will work on expanding your code to scan through all the balloons and update them automatically.

 

Great job though and very much appreciated.

 

Roger

 

 

0 Likes
Message 18 of 20

NachoShaw
Advisor
Advisor
I tried this method, it's very hard to determine when adding the balloon which part of the base model is being selected and it's only apparent once the code has been run. Not very efficient and by no means productive. However I have tested adding a click event instead that allows you to pick an edge and then a balloon is added with the solid name instead.

This show help you identify what is actually being clicked although I must stress that it's far from ideal

Thanks

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 19 of 20

rogmitch
Advocate
Advocate

Thanks for looking and I agree that adding the click event is probably  the right way go in the long run.   I am sure I can flesh out the initial idea to get something really helpful even if you may not agree with the basic premise.:)

 

0 Likes
Message 20 of 20

NachoShaw
Advisor
Advisor

well, i couldnt quite get my code to work correctly and then i got too busy at work to look at it again...

 

the issues i had were:

 

create a leader and click an edge to attach it to (by using the point where i clicked the mouse pointer) - this worked

adding the newly created leader to a select set so that i can override the text - this worked

overriding the text - this didnt work...

 

i'll look again over the weekend

 

 

 

 

thanks

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes