need help to add list to lisp

Hi.
I found a lisp (see attached) that joins lines,polylines and arc.
I need help with getting this lisp to do it only for items on specipic layers - this is the list I need the lisp to work by.
I inserted the list (named "Datalist") in to the lisp already,
and I need help with getting the lisp to use it and join only the objects of those layers.

I also Attached a sample file.

thanks,
aridzv.

Comments

  • Looks like you could change your SSGET call to the following:
    (setq sel (ssget "_:L" '((0 . "ARC,LINE,LWPOLYLINE")(-4 . "<OR")(8 . "P_DN*")(8 . "P_Later*")(-4 . "OR>"))))

    This adds an OR option to SSGET only allowing layers beginning with P_DN* or P_Later* to be selected. Using wild cards avoids the need to create an exhaustive list of layer names.

    For more info on using SSGET, I suggest that you check out this article on Lee Mac's site
    http://www.lee-mac.com/ssget.html

    Regards,
    Jason Bourhill
    BricsCAD V23 Ultimate
    CAD Concepts
  • Hello aridzv,
    As an alternative to Jason's code, you can also combine the entry in group code 8 with commas:
    (setq sel (ssget "_:L" (list '(0 . "ARC,LINE,LWPOLYLINE")
                                 (cons 8 (apply 'strcat
                                                (mapcar '(lambda(X)
                                                           (strcat X ",")
                                                           )
                                                  (mapcar ' car DataList))
                                                )
                                       ))))
    => (cons 8 "P_Laterl,P_DN16-4,P_DN16-6,.....")

    This should work, but I hav'nt tested it.
    regards
    Jörn
  • Hi @Jason Bourhill and @JoernBosse and thanks for your replies!!
    both worked!!
    thanks again,
    aridzv.