Author Topic: lol spot lisp  (Read 2243 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
lol spot lisp
« on: September 01, 2004, 03:08:23 PM »
I am having trouble make the text use current style... and i am having trouble adding a "X" to the begining of the line... can someone please help advise me.

thank you


Code: [Select]
(defun c:S2 ()
;; assumes 2 blocks available named "SpotLeft" and
;; "SpotRight" with different base points, a rectangle and
;; 2 attributes, text drawn at 1 unit high.
(setq TxtHt (getreal "\nText height for label: ")
Pt1 (getpoint"\nPick point for elevation: ")
Pt2 (getpoint Pt1 "nPick elevation label point: ")
)
(setq BkName (if (> (car Pt2) (car Pt1)) "SpotRight" "SpotLeft"))
(setq SpotElev (getreal "\nEnter elevation: ")
SpotHigh (+ 0.5 SpotElev)
SpotElevTxt (rtos SpotElev 2 2)
SpotHighTxt (rtos SpotHigh 2 2)
)
(command "line" pt1 pt2 "")
(command "-insert" BkName Pt2 TxtHt TxtHt 0 SpotElevTxt SpotHighTxt)
(princ)
)



(defun c:S1 ()
;; assumes 2 blocks available named "SpotLeft1" and
;; "SpotRight1" with different base points, a rectangle and
;; 1 attributes, text drawn at 1 unit high.
(setq TxtHt (getreal "\nText height for label: ")
      Pt1 (getpoint"\nPick point for elevation: ")
      Pt2 (getpoint Pt1 "nPick elevation label point: ")
)
(setq BkName (if (> (car Pt2) (car Pt1))  "SpotRight1" "SpotLeft1"))
(setq SpotElev (getreal "\nEnter elevation: ")
            SpotElevTxt (rtos SpotElev 2 2)      
)
(command "line" pt1 pt2 "")
(command "-insert" BkName Pt2 TxtHt TxtHt 0 SpotElevTxt SpotHighTxt)
(princ)
)
Civil3D 2020

jura

  • Guest
lol spot lisp
« Reply #1 on: September 02, 2004, 04:17:49 AM »
Maybe i miss understood, but when you insert a block it uses the text style in the block which was used to create the block.

Block created with style "test" set to "simplex.shx"

Block will be inserted with text style "test".

If style "test" doesn't exist it will be created with the font style defined in the block. If it does exist it will use the font style earlier defined in the drawing. (could be the same)

LISP is not gonna change that i guess.