Print Page | Close Window

Condition PROGN statement help

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=5233
Printed Date: 19.Apr.2026 at 08:04


Topic: Condition PROGN statement help
Posted By: kameron1967
Subject: Condition PROGN statement help
Date Posted: 31.Jan.2011 at 20:08
Can someone please look at this and help me do a condition ?
 
Basically, I want the program to decide if it's border1(zi3042sht) OR border #2 (i3042sht) and perform actions depending on which border it find.  Thank you, thank you, thank you!
 
[code](if (setq ss (ssget "x" (list (cons 0 "INSERT") (cons 2 "zi3042sht"))))
    (PROGN
(vla-put-Name
  (vla-item
    (vla-get-Blocks
      (vla-get-ActiveDocument
        (vlax-get-acad-object)
      )
    )
  "zi3042sht") ;;;<-- old block name
"abcde") ;;;< -- new block name
)
(if (setq B3Set (ssget "x" '((0 . "INSERT")(2 . "abcde"))))
       (progn
            (setq ename1 (ssname B3Set 0))
            (setq InsPt (cdr (assoc 10 (entget ename1))))
          (command "._move" "all" "" InsPt '(0.0 0.0))
; (command "._move" "all" "" mailto:0,0%20@2.06155%3c194" rel="nofollow - "0,0" "@2.06155<194 ")
)
)
     )
    (PROGN
  (if (setq ss (ssget "x" (list (cons 0 "INSERT") (cons 2 "i3042sht"))))
(vla-put-Name
  (vla-item
    (vla-get-Blocks
      (vla-get-ActiveDocument
        (vlax-get-acad-object)
      )
    )
  "i3042sht") ;;;<-- old block name
"abcde") ;;;< -- new block name
)
(if (setq B3Set (ssget "x" '((0 . "INSERT")(2 . "abcde"))))
       (progn
            (setq ename1 (ssname B3Set 0))
            (setq InsPt (cdr (assoc 10 (entget ename1))))
            (command "._move" "all" "" InsPt '(0.0 0.0))
 (command "._move" "all" "" mailto:0,0%20@2.06155%3c194" rel="nofollow - "0,0" "@2.06155<194 ")
)
)
    )
);end of IF
[\code}



Print Page | Close Window