- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone
I have created a lisp which is doing a few different things.
I have pt3 and pt4 set as part of the routine and mtext to be inserted. The main issue I have now is the mtext is always at 0-degree rotation inside the rectangles I create. Ideally I'd like the text to follow the direction of the longest side of the rectangle. I had tried to rotate by pt3 and pt4 which are midpoints of the short sides of the rectangle however it did not work and just stopped the lisp from repeating.
I was planning on moving the text to 'midpoint' which is something created earlier in the lisp to identify the midpoint of the rectangle created however as I have stumbled at the first hurdle I'm not sure where to go.
I added the command to rotate after the 'setq mtext (entmake (list'.
Below is a section of the routine with the rotation removed and as mentioned I'd like to rotate the text after the parameters for the mtext have been set
; Replace dimension with MText
(setq mtext (entmake
(list
'(0 . "MTEXT")
'(8 . "1A FF Beam") ; Layer name
(cons 10 (midpoint pt3 pt4)) ; Midpoint between pt3 and pt4
'(40 . 44.0) ; Text height
'(41 . 1.0) ; Relative scale factor
'(71 . 5) ; Attachment point (Middle center)
'(72 . 0) ; Justification code (Middle center)
'(7 . "7") ; Text color
'(90 . 0) ; Background fill (off)
(cons 1 string) ; Text string
'(210 0.0 0.0 1.0) ; Extrusion direction
)
)
)
Solved! Go to Solution.