ssget - viewport & dxf code 410

cadtank

Usenet Archive
Joined
Aug 22, 2003
Messages
7
Reaction score
0
not looking for code just a hint:

this works:
(SETQ ss (SSGET "X"
(list '(0 . "VIEWPORT")
'(8 . "defpoints")
) ;_ end of LIST
) ;_ end of SSGET
) ;_ end of SETQ

this does not:
(SETQ ss (SSGET "X"
(list '(0 . "VIEWPORT")
'(8 . "defpoints")
'(410 . "Sheet #")
) ;_ end of LIST
) ;_ end of SSGET
) ;_ end of SETQ
 
works now, thanks, had to restart for windows update & been working on it a while.

having to escape the character stinks, can't tie in ctab variable then without checking for '#' & other symbols.

thanks for the help.
 
Try this.

; Jason Piercey . September 10th, 2003
; function to return a string with escaped characters
; [string] - string, to search
; [escape] - string, characters to escape
; example:
; (escChrs "abc" "a") -> "`abc"
; (escChrs "abca" "a") -> "`abc`a"
; function dependencies: strChr
(defun escChrs (string escape)
(setq string (strChr string))
(setq escape (strChr escape))
(apply
'strcat
(foreach x string
(if (vl-position x escape)
(setq string (subst (strcat "`" x) x string)))
string
)
)
)

; Jason Piercey . September 10th, 2003
; function to return a list of single character
; strings from the characters within a stirng.
; {string] - string, to 'characterize'
; return: list of strings
; examples:
; (strChr "Abc") -> ("A" "b" c")
; (strChr "A b c") -> ("A" " " "b" " " c")
(defun strChr (string)
(mapcar
'(lambda (x)
(vl-list->string (list x)))
(vl-string->list string)
)
)

(setq name (escChrs (getvar "ctab") "#"))
"Sheet `#"

(setq ss (ssget "x" (list '(0 . "VIEWPORT") (cons 410 name))))
<Selection set: 8>
 
cool, you may have just written the single greatest piece of code ever.
 

Latest threads

Back
Top