- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, in the program copied below, I am attempting to insert a dynamic block with visibility state selection AND use a quantity function to prompt for quantity of blocks to insert. The QTY function part is not working. It does the single block insert fine, when you enter anything greater than 1 it inserts 1 then bails out with "error: bad function" in the command line (see lines in RED). Im using this QTY function in other programs and it works but in those cases I have a separate program being called in the IF part. Is there some reason that I cant have that AutoRotate and visibility state call in the QTY function? Am I just doing that part wrong? Thanks for looking
(defun C:iTRL () (iTRL nil))
(DEFUN iTRL (TYP / pt)
(GV)
(PB)
(SETVAR 'CLAYER "ACCESSORIES")
(initget 1)
(IF (NULL TYP)
(PROGN (INITGET "4' 6' 8' 3' 16\" SCREEN-PANEL")
(SETQ TYP (COND ((GETKWORD
"\nSpecify Trellis [4'/6'/8'/3'/16\"/SCREEN-PANEL] <SCREEN-PANEL>: "
)
)
("SCREEN-PANEL")
)
)
)
)
(COND
; ((= TYP "4'") (AutoRotateBlock "DYN_TRELLIS" nil 1) ;;; Basic single block insert function
; (chgdynprop (ENTLAST) "Visibility1" TYP)
; )
((= TYP "4'")
(INITGET 6) ;;;;;;; Insert with QTY, not working with qty greater than 1
(SETQ qty (GETINT "\nHow Many Trellises <1>: "))
(IF (>= qty 2)
(REPEAT qty ((AutoRotateBlock "DYN_TRELLIS" nil 1) (chgdynprop (ENTLAST) "Visibility" TYP))
)
((AutoRotateBlock "DYN_TRELLIS" nil 1) (chgdynprop (ENTLAST) "Visibility" TYP))
)
)
((= TYP "6'") (AutoRotateBlock "DYN_TRELLIS" nil 1)
(chgdynprop (ENTLAST) "Visibility1" TYP)
)
((= TYP "8'") (AutoRotateBlock "DYN_TRELLIS" nil 1)
(chgdynprop (ENTLAST) "Visibility1" TYP)
)
((= TYP "3'") (AutoRotateBlock "DYN_TRELLIS" nil 1)
(chgdynprop (ENTLAST) "Visibility1" TYP)
)
((= TYP "16\"") (AutoRotateBlock "DYN_TRELLIS" nil 1)
(chgdynprop (ENTLAST) "Visibility1" TYP)
)
((= TYP "SCREEN-PANEL")
(SETQ PNT (GETPOINT "\n\t\t =>> Pick a Location <<= "))
(if PNT
(progn
(vl-cmdf "-INSERT" "DYN_TRELLIS" PNT "" "" "" "")
(chgdynprop (entlast) "Visibility1" TYP)
)
)
(C:ESP)
)
)
(SV)
(PRINC)
)
Solved! Go to Solution.