home *** CD-ROM | disk | FTP | other *** search
- ' This simple macro prompts the user for a text string, then searches through the drawing
- ' looking for that string. If a match is found, the matching piece of text is selected.
- ' It not, a message is displayed. Note that this program only finds the first instance
- ' of the text string within the drawing, then quits. Both 2D and 3D text strings are tested.
- '
- ' Deselect everything before starting
- Sys(80) = 0
- '
- ' Un-remark these next 2 lines to make the input box appear in the upper
- ' left corner of the DesignCAD window, so it does not cover the drawing area.
- ' Sys(130) = 5
- ' Sys(131) = 5
- ' Get Text String from user
- Input "Enter Text to Search For . . .", TextStr$
- '
- ' Find total number of entities
- count = sys(9)
- ' Cycle through all entities
- For i = 1 To count
- ' Get each entity
- Entity(i)
- ' Determine Entity Type
- etype = Sys(90)
- ' If its 2-D text
- if etype=13 then
- Cur$ = Sys$(1)
- ' If there is a match
- if Cur$ = TextStr$ then goto break
- endif
- ' If its 3-D text
- if etype=3 then
- Cur$ = Sys$(1)
- ' If there is a match
- if Cur$ = TextStr$ then goto break2
- endif
- ' Loop back to next Entity
- next a
- Message "No Matching Text String Found in the drawing."
- End
- '
- Break:
- ' Select text
- putattr i, 13, 1
- >Regenerate
- {
- }
- End
- '
- Break2:
- ' Select text
- putattr i, 3, 1
- >Regenerate
- {
- }
- End
-