PDA

View Full Version : Check Block Insertion Point


ccowgill
2006-08-04, 01:34 PM
What is the dotted pair for an insertion point of 0,0,0?

I am writing a routine that checks to see if our title block is inserted at 0,0,0. We have 2 different names, CTLB is our Cover title block, and the * in TBL* represents a number 1-19 depending on how many things that need to be refined.

I get this error: Error: bad SSGET list value
For this code:

(if (/= (setq ss (ssget "_x"
(list '(-4 . "<and")
'(0 . "insert")
(CONS 410 (GETVAR "ctab"))
'(2 . "TBL*,CTLB")
'(10 . 0)
'(20 . 0)
'(30 . 0)
'(-4 . "and>")
) ;end list
) ;end ssget
) ;end setq
nil
) ;end =
();what to do if it is true
);end if

fixo
2006-08-04, 02:48 PM
Try to change all doted pairs, i.e.
instead of '(-4 . "<and") use (cons -4 "<and") etc
Your ssget list must to seems like

(if (/= (setq ss (ssget "_x"
(list (cons -4 "<and")
(cons 0 "insert")
(cons 410 (GETVAR "ctab"))
(cons 2 "TBL*,CTLB")
(cons 10 0); here must be insertion point as far as I know
(cons 20 0);what is it?
(cons 30 0);what is it?
(cons -4 "and>")
) ;end list
) ;end ssget
) ;end setq
nil
) ;end =


W/o testing though
Hth

~'J'~

Avatart
2006-08-04, 03:07 PM
Dotted pairs is the problem, below is with testing:

(if (/= (setq ss (ssget "_x"
(list '(-4 . "<and")
'(0 . "insert")
(CONS 410 (GETVAR "ctab"))
'(2 . "TBL*,CTLB")
(cons 10 '(0 0 0))
(cons 20 0)
(cons 30 0)
'(-4 . "and>")
) ;end list
) ;end ssget
) ;end setq
nil
) ;end =
();what to do if it is true
);end if

rkmcswain
2006-08-04, 03:11 PM
Give this a shot


(setq z (list 0.0 0.0 0.0))
(if (/= (setq ss (ssget "_x"
(list '(-4 . "<and")
'(0 . "insert")
(CONS 410 (GETVAR "ctab"))
'(2 . "TBL*,CTLB")
(cons 10 z)
'(-4 . "and>")
) ;end list
) ;end ssget
) ;end setq
nil
) ;end =
();what to do if it is true
);end if


Note that you don't need to check 20 and 30

ccowgill
2006-08-04, 04:06 PM
thanks for the help, I was trying to check x, y and z separately, but using (CONS 10 '(0 0 0)) did the trick.