Drawings, Find and Replace Datum target (Datum) and Weld Texts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
Hope everyone is well.
I got 2 issues to solve at the moment.
1st,
In drawings we use the Datum Target as an identifier to a table on our drawing. that are both manually placed in.
The datum is not being used as a Datum but more as an a fancy identifier for us.
Datum Targets have a dimension and a Datum we are trying to do a find and replace of the Datum which is a number.
Example would be
to
There would be other identifiers that would be in the drawing like this. 3 is what we are after to change and this would be throghout the sheet. so an example would be to change 3.2 to 5.2. i will post the current code i use for find and replacing some text below.
2nd.
We have a drawing that get converted to B units from A units. We call out many welds with the letter A (unit A) example is W-A001 needs to go to W-B001 as shown now the rub is that we may have 20 sheets of these to change on top we can have a unit C,D ect... Im looking for the commands to search and change this text. I have the code below that i used. I got it from giants in the coding arena and adjusted it to our needs.
I also want to thank all the people who have written or have had input to this code that truly understand programing. I'm sorry i have forgotten where i originally got this from please note I'm truly grateful.
oDoc = ThisDoc.Document Dim TXT2Find As String Dim NewTXT As String 'get user input TXT2Find = InputBox("Enter Text To Find:", "iLogic", "XXX") 'look for blank value If TXT2Find ="" Then Exit Sub NewTXT = InputBox("Enter Text To Replace '"& TXT2Find _ & "' with.", "iLogic", "****") For Each oSheet As Sheet In oDoc.Sheets 'DrawingDatumIdentifierEditCtxCmd For Each oGeneralNote As GeneralNote In oSheet.DrawingNotes.GeneralNotes oGeneralNote.FormattedText = oGeneralNote.FormattedText.Replace(TXT2Find,NewTXT) Next For Each oLeaderNote As LeaderNote In oSheet.DrawingNotes.LeaderNotes oLeaderNote.FormattedText = oLeaderNote.FormattedText.Replace(TXT2Find,NewTXT) Next 'dddddddddddddddddddddddddd 'For Each oSheet In oSheets For Each cDim As DrawingDimension In oSheet.DrawingDimensions If cDim.Text.FormattedText.Contains(TXT2Find) Then cDim.Text.FormattedText = cDim.Text.FormattedText.Replace(TXT2Find, NewTXT) End If 'For Each oDrawingDimensionNote As DrawingDimensionNote In oSheet.DrawingNotes.DrawingDimensionNote.DimensionNote 'oDrawingDimensionNote.FormattedText = oDrawingDimensionNote.FormattedText.Replace(TXT2Find, NewTXT) Next 'Next 'dddddddddddddddddddddddddddddd Next