
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Below is my lisp program and attached is the sample dwg.
It works fine - but I can't figure out how to have the input information (How many Joists?, What size joists?, What is the piecemark?) to populate the dynamic block attributes - "Qty", "Size", "Mark" - respectively.
Is this possible?
any ideas?
;-------------------------------------------------------------------------------------;;;
;;; ;;;
;;; Joist Multiple function ;;;
;;; Description: Labels multiple joists and inserts "joist Multiple" block ;;;
;;; ;;;
;;;-------------------------------------------------------------------------------------;;;
(defun C:JM (/ p1 p2 qty size mark oldlayer oldsnap olddim)
;; Save Current Layer
;; Set Current Layer and Object Snap settings
(setq oldlayer (getvar "clayer")
oldsnap (getvar 'osmode)
olddim (getvar "dimstyle"))
(command "_dimstyle" "_r" "piecemarks")
(setvar "osmode" 640)
(command "clayer" "joist marks")
;; get poinTs & insert block
(setq p1 (getpoint "\nPick point: ")
p2 (getpoint "\nPick Second point: ")
qty (getreal "\nHow many joists?: ")
size (getstring "\nWhat size joists?: ")
mark (getstring "\nWhat is the piecemark?: "))
(setq str (strcat (rtos qty 2 0) "-" size "-" mark))
(command "dimaligned" p1 p2 "text" str "@0,0")
(command "_.insert" "joist multi" p1 "" """" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "")
;; Reset Layer, OS, and Dimstyle
(setvar "clayer" oldlayer)
(setvar "osmode" 233)
(command "_dimstyle" "_r" olddim)
(princ)
)
;;; End function ;
Solved! Go to Solution.