Author Topic: If and Condition statement with revision block attribute  (Read 2014 times)

0 Members and 1 Guest are viewing this topic.

kameron1967

  • Guest
If and Condition statement with revision block attribute
« on: March 11, 2011, 12:43:44 PM »
I wonder if anyone can help me decide variable to set if R2NO exists.  If R2NO is blank, then use R1NO.  Here is the code.  Thanks.

Code: [Select]

;COND IF R2NO IS BLANK

 

(setq tags

   '(

       ("R2NO" . hyperlinkbase);REVA
    )
  )

 

;ELSE USE R1NO

 

  (setq tags
 
   '(
         ("R1NO" . hyperlinkbase);REVA
    )
  )
 

  (if (setq ss (ssget "_X" '((0 . "INSERT") (66 . 1) (2 . "REVBLOCKA")))); REPLACE TITLEBLOCK HERE!!!!
    (mapcar
      (function
        (lambda ( attrib / prop )
          (if (setq prop (cdr (assoc (strcase (vla-get-TagString attrib)) tags)))
            (vlax-put-property sum prop (vla-get-TextString attrib))
          )
        )
      )
      (vlax-invoke (vlax-ename->vla-object (ssname ss 0)) 'GetAttributes)
    )
  )

  (princ)

)
....