- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Select the block, and check the attribute value of C_NO. Based on the C_NO value, make the following modifications to the SLNO attribute:
- If C_NO = R1, set SLNO to 1
- If C_NO = Y1, set SLNO to 2
- If C_NO = B1, set SLNO to 3
- If C_NO = R2, set SLNO to 4
- If C_NO = Y2, set SLNO to 5
- If C_NO = B2, set SLNO to 6
Error - If the C_NO att has any extra stuff apart from RYB and 1234567890, ignore the extra stuff and filter to the result
Error - If C_NO is empty or not valid with the above. prompt C_NO value not valid
Error - If Block doesn't have these atts prompt Block invalid
(defun c:C2S (/)
(setq values-list '((R1 1) (Y1 2) (B1 3) (R2 4) (Y2 5) (B2 6)))
(setq block (car (entsel "\nSelect the block: ")))
(setpropertyvalue block "C_NO" C_NO)
(setq SLNO (getpropertyvalue block "SLNO"))
(princ "\nC_NO value not valid.")
(princ "\nNo block selected or invalid block.")
(princ "\nSLNO Updated Sucessfully.")
(princ)
)
If possible, this way I can easily modify the lisp later.
Attached block dwg file for reference
Solved! Go to Solution.
Link copied