CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 4584
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedCondition PROGN statement help

 Post Reply Post Reply
Author
kameron1967 View Drop Down
Groupie
Groupie


Joined: 30.Jan.2011
Location: United States
Using: autocad 2018
Status: Offline
Points: 29
Direct Link To This Post Topic: Condition PROGN statement help
    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" "" "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" "" "0,0" "@2.06155<194")
)
)
    )
);end of IF
[\code}
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,336 seconds.