adding multiple things to a non-active layer

Discussion in 'AutoCAD' started by coil, Aug 24, 2004.

  1. coil

    coil Guest

    ok ive asked a simlar question not to long ago but i came across a new problem.. i just cant seem to use any command to put multiple items onto the same non-active layer, mainly i've been trying to use the "apply" and "mapcar" functions. i've used them both alone and in conjunction with each other to no avail :(

    anyway when i do use them i get error messages like :bad agrument type: vla-object or it simple wont reconize the layer i'm trying to add it to. Saying somethign like it has a bad variant. Heres an example of the code=

    (apply 'mapcar (vla-put-layer (list (vla-addline *modelspace* pt1 pt2) (vla-addline *modelspace* pt1 pt2) (vla-addline *modelspace* pt1 pt2) ) "mylayer"))

    OR:

    (apply 'vla-put-layer (list (vla-addline *modelspace* pt1 pt2) (vla-addline *modelspace* pt1 pt2) (vla-addline *modelspace* pt1 pt2) ) "mylayer")

    and even:

    (mapcar 'vla-put-layer (list (vla-addline *modelspace* pt1 pt2) (vla-addline *modelspace* pt1 pt2) (vla-addline *modelspace* pt1 pt2) ) "mylayer")

    now like i said, this is only an example of it, so i apologize if i got to many "(" or ")".

    i would really apperacaite the help on understanding how to work this out.
     
    coil, Aug 24, 2004
    #1
  2. coil

    Jeff Mishler Guest

    Assuming *modelspace* is a valid opject for MS and the layer "Mylayer"
    exists:
    (mapcar '(lambda (x)
    (vla-put-layer x "mylayer"))
    (list (vla-addline *modelspace* pt1 pt2)
    (vla-addline *modelspace* pt1 pt2)
    (vla-addline *modelspace* pt1 pt2) )
    )

    --
    Jeff
    check out www.cadvault.com

    problem.. i just cant seem to use any command to put multiple items onto the
    same non-active layer, mainly i've been trying to use the "apply" and
    "mapcar" functions. i've used them both alone and in conjunction with each
    other to no avail :(
    vla-object or it simple wont reconize the layer i'm trying to add it to.
    Saying somethign like it has a bad variant. Heres an example of the code=
    (vla-addline *modelspace* pt1 pt2) (vla-addline *modelspace* pt1 pt2) )
    "mylayer"))
    (vla-addline *modelspace* pt1 pt2) (vla-addline *modelspace* pt1 pt2) )
    "mylayer")
    (vla-addline *modelspace* pt1 pt2) (vla-addline *modelspace* pt1 pt2) )
    "mylayer")
     
    Jeff Mishler, Aug 24, 2004
    #2
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.