Add drawing iproperty as a prefix to balloon

Add drawing iproperty as a prefix to balloon

Anonymous
Not applicable
352 Views
1 Reply
Message 1 of 2

Add drawing iproperty as a prefix to balloon

Anonymous
Not applicable

Hi guys,

 

Im trying to add a prefix to balloons. I would like to add the drawing number of the 'active drawing' as the prefix. (The drawing number is an iproperty in the drawing file)

 

I have looked through the balloon styles etc. and you can add other information to balloons but I think it is only model related information, i.e....information that is only in the properties of the model files and not in the drawing file. I could manually enter the drawing number, into a the ballooned parts iproperty, of the drawing that each part appears on but this would be time consuming.

 

If I logic is the answer I think the code would need to:

 

copy the drawing number of the drawing file (iproperties value 'title') to an iproperties value of all the ballooned parts. (doesn't matter what iproperties value)

 

If I could get this to work then I can edit the balloon styles to display the number AND the iproperties value in every part that now contains the drawing number.

 

Thanks,

Sandy

0 Likes
353 Views
1 Reply
Reply (1)
Message 2 of 2

marcin_otręba
Advisor
Advisor

Try this (it is vba macro - one is to set, second to reset balloon number) - it will overwrite number in partslist and in balloon:

 

Sub set_pref()
Dim odoc As DrawingDocument
Set odoc = ThisApplication.ActiveDocument
Dim prtlist As PartsList
Dim ocell As PartsListCell
Dim orow As PartsListRow
For Each orow In prtlist.PartsListRows
Set ocell = orow.Item(1)
ocell.Value = odoc.PropertySets.Item(1).Item("Title").Value & " - " & ocell.Value
Next
End Sub


Sub reset_pref()
Dim odoc As DrawingDocument
Set odoc = ThisApplication.ActiveDocument
Dim prtlist As PartsList
Dim ocell As PartsListCell
Dim orow As PartsListRow
For Each orow In prtlist.PartsListRows
Set ocell = orow.Item(1)
ocell.Static = False
Next
End Sub

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes