ssget getlast entget line/polyline identy data 2002->2005

Discussion in 'AutoCAD' started by vandenbussche stijn, Mar 10, 2005.

  1. We have a lisp routine that when you start it it ask you to select an
    object.

    then it change the layer to the name of the layer where the object is on and
    it ads "-bemating" after it

    so object is on layer : ducts

    I select the object it changes the layer to ducts-bemating and then it
    starts an other command like LINE or text

    now when changing to 2005 I occured a problem
    when the object is a line or objects like that everyting is oke but when it
    is a POLYLINE it doesn't work anymore

    the part where it gives a problem I put between ---------------------.
    I discovered that I can't use sSSGET anymore for polylines and I have to use
    entget entlast or similar now but I can't figure out how to get the
    layername out of it.

    THis is a part of the lisp routine

    (setvar "osmode" 512)
    (setq pnt1 (getpoint "\n Geef startpunt: ")) ;(selecting a point on the
    object)
    (setvar "osmode" 0)

    ;bepalen van selectiegroep pnt1 voor het bepalen van de entiteit naam
    ;here is the problem if it's done on a polyline
    ------------------------------------------------------
    (setq sgroep1 (ssget pnt1))
    (setq object (ssname sgroep1 0))
    ----------------------------------------------------

    ;layer entiteitnaam curent maken

    (setvar "clayer" (cdr (assoc 8 (entget object ))))

    ;alles bylayer plaatsen

    (command "cecolor" "bylayer")
    (command "celtype" "bylayer")
    (command "-lweight" "bylayer")
     
    vandenbussche stijn, Mar 10, 2005
    #1
  2. vandenbussche stijn

    TomD Guest

    I think you are misinterpreting where the problem is actually occurring.

    From what I can tell from the partial code you posted, the following lines:

    (setq pnt1 (getpoint "\n Geef startpunt: "))
    ------------------------------------------------------
    (setq sgroep1 (ssget pnt1))
    (setq object (ssname sgroep1 0))
    ----------------------------------------------------

    should be replaced with something like:

    (setq esel (entsel "\nSelect object: ")
    pnt1 (cadr esel)
    object (car esel)
    )

    I cannot say for sure this is what I would do, because I don't what all the
    pnt1 is being stored for.

    I think your error is being generated when the user misses during the
    selection process. It seems that the intent is for the user to select only
    one object, in which case the code I posted (or some variation) would be
    more appropriate.

    (Apologies for the language difference. I'm hoping this will make sense.)
     
    TomD, Mar 10, 2005
    #2
  3. I will explain better :
    what it does :

    first it ask you to select a point on an identity.no matter what.
    That point is stored in "pnt1" from that point the line wil be drawn.

    Before the line is drawn i need to know wher it has to come on.
    That I know because I extract the layer name and then add "-bemating" after
    it.

    This worked allways perfectly but in 2005 it isn't anymore.
    When I do it on polyline it gives an error. not when it is a pline with
    width "0" or very small but when pline is drawn a little widther I get the
    "error: bad argument type: lselsetp nil" error.
    As it doesn't get's a point selected.
    The point selection is done with the "nearest " osnap. It seems when the
    Pline is widther then the "nearest osnap symbol"(the lookalike"hour glass"
    symbol) it doesn't work anymore.

    When It ask me to select a point use the "end osnap" on the big pline it
    works.So I should implement something that it keeps asking for a point till
    it gets one.

    We use this -system- a lot. we do the same for or text so when you ad text
    to an object you point at the object it determines the layer it is on and
    ads layername "-tekst" after it and sets that one current
     
    vandenbussche stijn, Mar 11, 2005
    #3
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.