Tag Number in each purchased item in an assembly and call it in drawing

Tag Number in each purchased item in an assembly and call it in drawing

Anonymous
Not applicable
3,566 Views
28 Replies
Message 1 of 29

Tag Number in each purchased item in an assembly and call it in drawing

Anonymous
Not applicable

Dear  all expert.

 

I've problem to create tagging number in inventor assembly call it in the drawing.

 

my case.

in an assembly of piping, I need to add two unit of valve (same valve), 

but i need to create different TAG Number in each unit.. i.e Valve-1 & Valve-2.

I can do it by renaming Occurence name in the assembly browser.

 

My problem is,

1. How to call each TAG Number in the drawing. (by custom leader or skecth Symbols).

    is there any tricks or iLogic codes to call this?

2. Add Tag Number value in the Part List Colomb without manual input.

 

to ilustrate this case, please see attached images below..

 

Please your help.

 

&

 

Thanks in advance.

akhidumm..

0 Likes
Accepted solutions (2)
3,567 Views
28 Replies
Replies (28)
Message 2 of 29

salariua
Mentor
Mentor
Accepted solution

I have just recently answered this on youtube and I will just paste the info from there:

 

"

 

The only way to tag equipment was to use assembly browser name. It is unique to each occurrence (component) and while a valve can be used 100 times in the assembly and reside in library (read only folder) you can change the browser name in the assembly and give it an unique ID.

 

Start with this post where I am explaining this concept and the setup of custom balloons in the drawing.

http://blog.ads-sol.com/2014/08/component-tags-in-inventor.html

 

Then read the update on tagging from the assembly, which might be faster/preferred by some people.

http://blog.ads-sol.com/2014/10/part-tagging.html

 

Then there’s the final code to use in the drawing which merges both codes and creates the balloon on the drawing and renames the assembly browser node. If that component (eg. Valve) is tagged then it’s getting the current tag.

http://blog.ads-sol.com/2015/02/component-tagging.html

 

 

I should mention that it is possible to create a custom table to extract tagged equipment with any iproperties you wish along (eg. PN, Description, Stock Number, etc.)

 

here's how to create custom table:

http://blog.ads-sol.com/2015/05/custom-table-on-drawing.html

 

and here's how to edit a Parts List table:

http://blog.ads-sol.com/2014/08/info-table-in-drawing.html

 

"

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 3 of 29

Anonymous
Not applicable

hi adrian,

 

Thanks a lot for your answer and the refference.

i will try all of your advice in your blog.

 

and will inform you the result soon.

 

Thank in advanced.

 

 

0 Likes
Message 4 of 29

salariua
Mentor
Mentor

That looks like a Pharma, Dairy type of job. What company are you with?

 

I am with Veolia Water in UK.

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 5 of 29

Anonymous
Not applicable
hi Adrian, you're correct.
i'm from pharma & cosmetics company in Indonesia.
0 Likes
Message 6 of 29

Anonymous
Not applicable

hi adrian,

 

create iassembly / ipart is a good solution for single project

my problem is, all my equipment is get from library (vault library)... so iassembly/ipart is not good a soluition for us.

I need all taging done in browser node (renaming occurence name) and call it in the drawing & part list.

 

 

0 Likes
Message 7 of 29

salariua
Mentor
Mentor
Accepted solution

Not sure I understan and I am hoping you can develop a bit.

 

I am not using iParts/iAssemblies for tagging.

 

Have you tried the code in my links? Download it and try it on a drawing, see how that goes.

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 8 of 29

Anonymous
Not applicable

Thanks alot adrian.
may i'm not good reader before..
but now, it's solve by your blog refference....

 

Thannks in advance

0 Likes
Message 9 of 29

Jef_E
Collaborator
Collaborator

Hi @salariua,

 

Thank you for those links, they are pretty helpfull! I tried implementing it into my workflow, with some success but not the result i'm looking for.

 

I'm from the petrochemical vessel building industry, and looking for a way to add identical nozzle connections. But still have the ability to balloon them seperately with their mark number. I think that sounds quite familiar to you, only difference you create the pipeline, and I the vessel it's attached to?

 

Anyway here is a quick preview of what my assembly browser tree looks like.

 

  • Vessel
    • Nozzle 1
      • Flange
      • Pipe
      • ...
    • Nozzle 2
      • Flange
      • Pipe
      • ...
    • Nozzle 3
      • Flange
      • Pipe
      • Internal attachement
        • Internal Flange
        • Internal Pipe
        • ...

 

When I use your method posted in the first link, the item the balloon is attached to it's browser name is shown. For example I Balloon [Nozzle 1] run the code and the balloon text becomes [Flange]. This is because the leader is attached to the flange and not the assembly. Is there a way to work around this?

 

An more extreme example would be for [Nozzle 3] the user selects a part of the internal to balloon it, and the balloon shows [Internal Flange]. In this example it still would be required to show [Nozzle 3]. So there is a sub-sub assembly, which is not so uncommon (where I work).

 

When doing it by the method provided by autodesk, you can expand or collapse items. And this defines the balloon content. Could this also be done here? Or using some other method?

 

 



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 10 of 29

salariua
Mentor
Mentor

Hi Jef,

 

 

my need is to have the balloon (tag) linked to the part no matter how deep it resides inside the assembly. I am selecting valves and instruments no 4-5 levels down, TP, run, routes, etc...

 

I thin in your case balloons should do it. you need to document the nozzle anyway in the parts list or nozzle list (conn list).

 

why don't you create a custom balloon with browser name (will test and see if it works) or create a custom parameter on each Nozzle subassembly and call that in the drawing for balloons and Parts List table?

 

I will do a screencast...give me a second.

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 11 of 29

salariua
Mentor
Mentor

Check the Screencast,

 

would this help you ? is this a valid solution for you? Notice that I am ballooning parts as well as subassemblies. If you need to balloon parts from within subassemblies then make that subassembly Phantom in BOM.

 

You don't need to create those parameters ahead in the template, if you add those rows to the BOM and when you fill the cell value, the custom iproperty gets created automatically for you.

 

I do recommend that you save the BOM template as xml and you import it every time (or set it in asm template).

 

http://blog.ads-sol.com/2015/06/inventor-assembly-template.html

 

Oh...... this will not work if you have duplicate nozzle like same assembly being Nozzle 3 and Nozzle 5 which I am guess you might...... 😞 

 

back to drawing board.... will keep thinking.

 

On a separate note, you can balloon as ussual (which will get top level components) and then use ilogic to override the value with it's occurrence.name (browser name) but you can't use Parts List because it shows each component once. We would need ilogic to create a custom table....

 

screencast server takes forever to process my recording, should have done it as gif...

 

I am giving up.... I will put the link when the screencast server makes it available.

 

for now anser this: do you use same assembly or part for different nozzle numbers? 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 12 of 29

Jef_E
Collaborator
Collaborator

@salariua wrote:

for now anser this: do you use same assembly or part for different nozzle numbers? 


Yes, thats the idea, only difference would be the name (browser name) and position (constraints).

 

Thanks for the respons, I will sleep over it tonight maybe I can come up with something aswell.



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 13 of 29

salariua
Mentor
Mentor

Hi Jef,

 

the screencast is ready, 4 hours later.... 

 

I know it's not what you are after but there's good info there.

 

The solution for you is simple. Balloon as ussual every component, then use ilogic to rename that balloon and override it with occurrence.name (browser name).

 

something like:

 

while I keep selecting balloons (or for every existing balloon in the drawing) add custom value to it by using referenced component occurrence.name

if you need you can add it to a custom balloon type, like I have, hex shape to diferentiate it better.

 

I will get some code for you in the morning.

 

here's the screencast

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 14 of 29

Jef_E
Collaborator
Collaborator

Thats exactly what I do now, only I use the Title iProperty.

 

May I ask where you are from? I see some dutch in partslist? 🙂



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 15 of 29

salariua
Mentor
Mentor

Hi Jef,

 

I am a weirdo and a true result of globalisation. I am Romanian, working with Veolia Water Technologies in UK, and the drawing was done by a supplier in Nederlands for a job in Denmark :)) or something along those lines.

 

I needed the 3D model to incorporate it in my plant layout so they sent a STEP over. We are not Vessel designers but we do create tank drawings for quoting purposes. It just happen that the dutch model was close at hand.

 

I have finalized a version of the code but it can be changed to suit your needs.

 

Like I've mentioned before, I recommend that you create a new custom Balloon style ("Tag" in my code, maybe change it to "Nozzle" to make it more obvious and change shape to differentiate it) and you balloon as usual choosing "Tag" style (or change them all at the end) then run the code and watch the magic ( i wish, poor programing on my side :)) ).

 

If you don't create a custom style and balloon first you can mix match this with my original code and create balloons on the fly.

 

Try this out and let me know how that goes.

 

' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

' Set a reference to the active sheet.
Dim oActiveSheet As Sheet
oActiveSheet = oDrawDoc.ActiveSheet


Dim oStyles As DrawingStylesManager
oStyles = oDrawDoc.StylesManager

Dim oCurve As DrawingCurve
Dim oEdge As EdgeProxy
Dim occurrence As ComponentOccurrence 
'Dim oParentOcc As ComponentOccurrence
Dim oGeometryIntent As GeometryIntent


'----------Update existing balloons on all sheets

'Ask the user if he wants to update values of all balloons (if edited some)
booleanParam = InputRadioBox("Update existing balloons?: ", "Yes", "No", True, Title :="Update Existing?")

If booleanParam = False Then
	Exit Sub
ElseIf booleanParam = True
	
	'process all sheets
	For Each oSheets In oDrawDoc.Sheets 
		' Iterate over each balloon on the sheet.
		For Each oBalloon In oActiveSheet.Balloons
			If oBalloon.Style.Name = "Tags" Then
				Try
					Dim leader As Leader
					Leader = oBalloon.Leader
					'assuming the leader is a single line segment
					Dim leaderNode As LeaderNode 
					leaderNode = leader.AllNodes(2)
					
					oGeometryIntent = leaderNode.AttachedEntity
				
					curve = oGeometryIntent.Geometry
				
					oEdge = curve.ModelGeometry
		
					occurrence = oEdge.ContainingOccurrence
					
					'-------------------------------------------
					
					'MessageBox.Show("Leaf Occ name: " & occurrence.Name,"ilogic")
					
					TestParent = True
					
					While Not occurrence.ParentOccurrence Is Nothing
					'MessageBox.Show("Parent Occ name: " & occurrence.ParentOccurrence.Name,"ilogic")
					occurrence = occurrence.ParentOccurrence
					'MessageBox.Show("cur Occ name: " & occurrence.Name,"ilogic")
					
					End While 'end test for parent
					
					
'					'-------------------------------------------
					Retry = True
					
					'as long as retry is selected by user
					While Retry
						'get tag from user
						oTagOcc = InputBox("Enter Tag No: ", "Tag Prompt", occurrence.Name)
			
						Try
							' try and set that value
							occurrence.Name = oTagOcc
							'if success exit the retrying loop
							Exit While
						'if tag allready exists
						Catch
							'prompt if user wants to try again
							Retry = InputRadioBox("Allready used, try again", "Yes", "No", Retry, Title := "Retry")
						End Try
					End While
					
					'if user canceled the retry skip the rest of the code and
					'prompt to select parts again
					If Retry = False Then
						'Continue While
						Exit For
					End If
					
					' Iterate over each value set (attached balloons) in a balloon.
					For Each oBalloonValueSet In oBalloon.BalloonValueSets
						' Set balloon value from browser.
						oBalloonValueSet.OverrideValue = occurrence.Name
					Next 'go to next balloon
				Catch'do nothing if error
				End Try
			End If 'end of search for Tags balloons
		Next
	Next
End If

'----------End Update existing balloons on all sheets

 

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 16 of 29

salariua
Mentor
Mentor

small mistakes on the code not affecting it's functionality

 

 

TestParent = True

is not really needed.

 

To speed things up you might want to rename browser nodes form the assembly (visually better)

 

then run the drawing code and just confirm prompts.

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
0 Likes
Message 17 of 29

Jef_E
Collaborator
Collaborator

Hi!

 

I will try it as soon as possible, weird thing is I didn't get an email notification of your response.. Just happened to notic your post now, sorry for the delay!



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 18 of 29

Jef_E
Collaborator
Collaborator

Hi!

 

I tested the code, adjusted it a little bit, and it seems to work as it should.

 

My edited code

 

Spoiler
    Public Sub BalloonFromBrowser(ByVal oBalloonStyleName As String)

        ' Set a reference to the drawing document.
        ' This assumes a drawing document is active.
        Dim oDrawDoc As DrawingDocument
        oDrawDoc = EM_AddIn.StandardAddInServer.m_inventorApplication.ActiveDocument

        ' Set a reference to the active sheet.
        Dim oActiveSheet As Sheet
        oActiveSheet = oDrawDoc.ActiveSheet

        ' Set a reference to the drawing styles manager.
        Dim oStyles As DrawingStylesManager
        oStyles = oDrawDoc.StylesManager

        ' Iterate over each balloon on the sheet.
        For Each oBalloon In oActiveSheet.Balloons

            ' Check the balloon style by name.
            If oBalloon.Style.Name = oBalloonStyleName Then
                Try
                    Dim oLeader As Leader
                    oLeader = oBalloon.Leader

                    'assuming the leader is a single line segment
                    Dim leaderNode As LeaderNode
                    leaderNode = oLeader.AllNodes(2)

                    ' Get the occurrence attached to the balloon.
                    Dim oOccurrence As ComponentOccurrence
                    oOccurrence = leaderNode.AttachedEntity.Geometry.ModelGeometry.ContainingOccurrence

                    ' Check for the parent occurrence.
                    ' If the parent occurrence is nothing than it's the top assembly / part 
                    ' and this oOccurrence browser-name will be shown in the balloon.                    ' 
                    While Not oOccurrence.ParentOccurrence Is Nothing

                        oOccurrence = oOccurrence.ParentOccurrence

                    End While 'end test for parent

                    ' Iterate over each value set (attached balloons) in a balloon.
                    For Each oBalloonValueSet In oBalloon.BalloonValueSets
                        ' Set balloon value from browser.
                        oBalloonValueSet.OverrideValue = oOccurrence.Name
                    Next

                Catch 'do nothing if error
                End Try

            End If
        Next

    End Sub

 

I just have some questions about it.

 

What does this mean a single line segment? The nodes are the green dot's when clicking on a leader/balloon?

'assuming the leader is a single line segment
Dim leaderNode As LeaderNode
leaderNode = oLeader.AllNodes(2)

What does this do exactly? Does it also overwrite balloons attached from list?

' Iterate over each value set (attached balloons) in a balloon.
For Each oBalloonValueSet In oBalloon.BalloonValueSets
       ' Set balloon value from browser.
        oBalloonValueSet.OverrideValue = oOccurrence.Name
Next

 



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 19 of 29

salariua
Mentor
Mentor

Hi Jef,

 

I don't always get emails, long problem I have. I am actually a copycat, merging bits of code from various sources and testing/adjusting till it works.

 

Balloons can have more than one segment, a leader line and more following segments. In 2017 you can set it to single line and my understanding of the nodes is as yours.


I just have some questions about it.

 

What does this mean a single line segment? The nodes are the green dot's when clicking on a leader/balloon?

'assuming the leader is a single line segment
Dim leaderNode As LeaderNode
leaderNode = oLeader.AllNodes(2)

 

 

 

What does this do exactly? Does it also overwrite balloons attached from list?

' Iterate over each value set (attached balloons) in a balloon.
For Each oBalloonValueSet In oBalloon.BalloonValueSets
       ' Set balloon value from browser.
        oBalloonValueSet.OverrideValue = oOccurrence.Name
Next

 

This I have actually copied over from a different code where I prompt the user to set a custom value (override) on each balloon, if the user has more than one in a set.


 

 

Here's how to find component from balloon.

 

In the API help pages, there are 3 examples on "Balloons - Edit", "Creating a balloon" and "Find component referenced by balloon"

 

Did you installed the API help?

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!
Message 20 of 29

Jef_E
Collaborator
Collaborator

Hi @salariua

 

I have been playing a bit more with the tools you provided, and I found that it works well! Kudo's for this workaround that Autodesk did not provide in their costly software.

 

None the less I'm still a bit stuck, and I wonder how you handle these situations. In my screencast you can see that there are 2 sub-assemblies placed multiple times. A large nozzle and a small.

 

The large ones are positioned at the same orientation, and the small ones are also on the same orientation. this means in the TOP view there are only 2 nozzle visible out of 5. But I should balloon them all. Is there a way to attach a balloon to a line that lays onder another line? Or do you just add them manually?

 

Don't mind the cylinders in this screencast it's just for testing purposes.



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes