home *** CD-ROM | disk | FTP | other *** search
- ' This macro changes the font of existing text
- '
- ' Array to hold selected items
- Dim ent(500)
- count = sys(9)
- For a = 1 To count
- Entity(a)
- etype = Sys(90)
- if etype=3 then
- putattr a, 3, 1
- >converttext
- {
- }
- 'getselect a, ent(a)
- endif
- next a
- farx=sys(122) 'get the max x value for entire drawing
- 'so a point can be place away from the drawing
- 'deselecting anything in the drawing, as
- 'anything selected will later be deleted
- >pointselect
- {
- <type 0
- <pointxyz [farx+25,12]
- }
- dim jx(200), jy(200), jz(200) 'initilize my arrays
- count = sys(9) 'find total number of entities
- For i = 1 To count 'cycle through all entities
- Entity(i) 'get each entity
- etype = Sys(90) 'find out what entity you have is
- if etype=13 then 'if its 2-D text
- putattr i, 13, 1 'select it
- goto nexoop 'skip to the main part of macro
- endif
- goto bottom 'skip over main part if not 2-D text
- nexoop:
- 'make it 3-D text...better point representation
- >converttext
- {
- }
- For j = 1 To sys(1) 'cycle through the points
- pointval jx(j) jy(j) jz(j) j 'put them in an array
- next j
- angles=sys(97)*sys(32) 'find the angle of the text
- text$=Sys$(1) 'get the content of the text
- just=sys(257) 'find the justification
- squaredx=sqr(jx(1)-jx(3)) 'do some math to find the height
- squaredy=sqr(jy(1)-jy(3)) 'of the text...square root of x distance
- height=sqrt(squaredx+squaredy) 'squared+y distance squared
- 'place that text
- >text2D
- {
- <justification [just]
- <font "Times New Roman"
- <text [text$]
- <size [height]
- <pointxyz [jx(1),jy(1),jz(1)]
- <pointpolar 10,[angles],0
- }
- bottom: 'this is where you would end up if you weren't 2-D text
- next i 'go get the next entity
- >selectdelete
- {
- }
- End 'the end