Hi @NhatHaBG. This is a pretty new capability, but they do have a VBA code example for creating a new one in a drawing. The link to that example is below:
https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DrawingWeldingSymbolCreation_Sample
In that example, you can see the path for how to get to these objects.
Sheet.WeldingSymbols, which returns a DrawingWeldingSymbols collection object. Then DrawingWeldingSymbols.Item() property can then be used to get a DrawingWeldingSymbol object by its Index number. Then you can use DrawingWeldingSymbol.Definitions property to get a DrawingWeldingSymbolDefinitions object. Then you can use DrawingWeldingSymbolDefinitions.Item property to get one of its DrawingWeldingSymbolDefinition objects. Then you can use its DrawingWeldingSymbolDefinition.TailNote property, which is Read/Write, and contains a String.
Wesley Crihfield
(Not an Autodesk Employee)
This will do.
First select the weld-symbols in the drawing and let then the code run.
Dim d As Inventor.DrawingDocument = ThisDrawing.Document
Dim s As Inventor.SelectSet = d.SelectSet
For Each oWeldingSymDef As Inventor.DrawingWeldingSymbol In s
Dim dwd As Inventor.DrawingWeldingSymbolDefinitions = oWeldingSymDef.Definitions
dwd.Item(1).TailNote = "HOW CAN I EDIT THIS"
Next
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Oh this is new function, great
However, I can't find the welding symbol that is created in welds using the above method.
Can you show me how to access it; Thanks
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Hi @NhatHaBG. I believe that accessing the WeldSymbol object on the model side may only be possible if you have created a 3D annotation for it. You can create 3D annotations that are welding symbols from the Annotate tab of a model document. The welding symbols you create that way can be accessed like the below example. And the TailNote property is Read/Write here too.
Sub Main
'if it is not a Weldment type Assembly, then let user know and exit rule
If ThisDoc.Document.SubType <> "{28EC8354-9024-440F-A8A2-0E0E55D635B0}" Then
MsgBox("A Weldment type Assembly must be active for this rule to work. Exiting rule.", vbCritical, "iLogic")
Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oWeldmentDef As WeldmentComponentDefinition = oADoc.ComponentDefinition
Dim oMWSs As ModelWeldingSymbols = oWeldmentDef.ModelAnnotations.ModelWeldingSymbols
If oMWSs.Count > 0 Then
For Each oMWS As ModelWeldingSymbol In oMWSs
Logger.Info("Name = " & oMWS.Name)
Dim oMWSDefs As ModelWeldingSymbolDefinitions = oMWS.Definitions
For Each oMWSDef As ModelWeldingSymbolDefinition In oMWSDefs
Logger.Info("TailNote = " & oMWSDef.TailNote)
Dim oWS1 As WeldSymbol = oMWSDef.WeldSymbolOne
Try : Logger.Info("WeldSymbol Above Ref Line Thickness = " & oWS1.Thickness) : Catch : End Try
Dim oWS2 As WeldSymbol = oMWSDef.WeldSymbolTwo
Try : Logger.Info("WeldSymbol Below Ref Line Thickness = " & oWS2.Thickness) : Catch : End Try
Next
Next 'oMWS
Else
Logger.Info("There were no ModelWeldingSymbols.")
End If
End Sub
Those will be the ones you see inside the Annotations browser folder in your model browser tree. But I do not believe we have direct access to the true weld symbols that are located below the 'Welds' folder in the model browser tree through the API yet. We can access the information that is included within those 'real' symbols indirectly, but it is ReadOnly, and formatted with XML tags though. The only WeldBead objects that will include any data within the WeldInfo property are the ones you have created 'real' weld symbols for.
Sub Main
'if it is not a Weldment type Assembly, then let user know and exit rule
If ThisDoc.Document.SubType <> "{28EC8354-9024-440F-A8A2-0E0E55D635B0}" Then
MsgBox("A Weldment type Assembly must be active for this rule to work. Exiting rule.", vbCritical, "iLogic")
Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oWeldmentDef As WeldmentComponentDefinition = oADoc.ComponentDefinition
Dim oWeldsDef As WeldsComponentDefinition = oWeldmentDef.WeldsComponentDefinition
Dim oWelds As Welds = oWeldmentDef.Welds
Dim oBeads As WeldBeads = oWelds.WeldBeads
For Each oBead As WeldBead In oBeads
'Dim oSymAPoint As Point = oBead.SymbolAttachPoint 'ReadOnly
'Dim oSymBPoint As Point = oBead.SymbolBreakPoint 'ReadOnly
Logger.Info("oBead.Name = " & oBead.Name & vbCrLf & _
"oBead.WeldInfo:" & vbCrLf & oBead.WeldInfo)
Next 'oBead
End Sub
Wesley Crihfield
(Not an Autodesk Employee)
How are you doing, this code works well and give some insight of how this command works.
you can select all the welds and change them all at once. I have tried to modify this so that i can do a find and replace per sheet and for the life of me can not figure out how to do this. we have many sheets and many welds that will be updated per job that is currently done manually. I would like to replace 1A with A for the whole sheet. leaving 008
example:
W-1A008 would be W-A008
W-1A009 Would be W-A009
I use this for user interface
Any help would be great.
Please send me a private message and we will have a look, for creating an add in with find and replace functionality.
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Is this maybe coming close to what you need via an add-in?
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !