ssget - viewport & dxf code 410

Discussion in 'AutoCAD' started by cadtank, Sep 10, 2003.

  1. cadtank

    cadtank Guest

    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
     
    cadtank, Sep 10, 2003
    #1
  2. Try escaping the # character.

    '(410 . "Sheet `#")
     
    Jason Piercey, Sep 10, 2003
    #2
  3. cadtank

    cadtank Guest

    no workie!
     
    cadtank, Sep 10, 2003
    #3
  4. You sure? Worked fine here.
     
    Jason Piercey, Sep 10, 2003
    #4
  5. cadtank

    cadtank Guest

    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.
     
    cadtank, Sep 10, 2003
    #5
  6. 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>
     
    Jason Piercey, Sep 11, 2003
    #6
  7. Should of noted, that [string] is case sensitive.
     
    Jason Piercey, Sep 11, 2003
    #7
  8. cadtank

    cadtank Guest

    cool, you may have just written the single greatest piece of code ever.
     
    cadtank, Sep 11, 2003
    #8
  9. Well, <blushing>

    Thanks, but I doubt that..... Hope it proves to be useful.
     
    Jason Piercey, Sep 11, 2003
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.