Replacing added custom text to dimension (drawing)

Replacing added custom text to dimension (drawing)

Rob987654
Participant Participant
457 Views
2 Replies
Message 1 of 3

Replacing added custom text to dimension (drawing)

Rob987654
Participant
Participant

Hi all,

 

Is it possible with ilogic to iterate through all dimensions on a drawing sheet and replace the added custom text? See example below. All dimensions that don't have 'TextAA' may not change. Thank you in advance.

 

Current situation:       <--   Ø20 (TextAA) -->>

Desired situation:       <-- Ø20 (TextBB) -->>

0 Likes
Accepted solutions (1)
458 Views
2 Replies
Replies (2)
Message 2 of 3

dutt.thakar
Collaborator
Collaborator
Accepted solution

@Rob987654 

 

See below rule, It will remove TextAA from all the dimensions that has it and replace it with TextBB

You can replace "TextAA" with something else as well if you desire as well.

 

	Dim oDoc As DrawingDocument
  	oDoc = ThisApplication.ActiveDocument
        Dim oSheet As Sheet = oDoc.ActiveSheet
	For Each oGD As DrawingDimension In oSheet.DrawingDimensions
		If oGD.Text.FormattedText.Contains("TextAA")
			oGD.Text.FormattedText = "" ' This will remove "TextAA" from all the dimensions that has it previously
		        oGD.Text.FormattedText = "TextBB" 'This line will replace "TextAA" with "TextBB"
End If Next

 Hope this is useful.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
Message 3 of 3

WCrihfield
Mentor
Mentor

oops, wrong post.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes