Insert a round block using any quandrant

Discussion in 'AutoCAD' started by John Crocco, Jun 4, 2004.

  1. John Crocco

    James Allen Guest

    But CopyObjects doesn't work if the object is in an xref, right? I modified
    it because the mod was simpler, but more importantly worked equally well on
    an xref, I thought.

    I've looked through the posts I could find on "(entmake (entget" a bit more
    and it seems Tony (and perhaps others) would say to avoid (entxxxx)
    altogether. I know I'm a newcomer here and have a lot to learn, but having
    looked through the previous posts I find myself still wondering if it isn't
    worth using in this case.

    The situation: I (and John if I understand his need correctly) basically
    just want to accurately copy the geometry from an nentselp, even from an
    xref. Unless I've missed something, the xref part wipes out the vla-
    methods and even (command "copy"..., leaving us with (entmake (entget... or
    learn a whole new language.

    So, if we're
    1. okay with this being limited to "simple" objects,
    2. don't care about optional properties (color, ltype, and such),
    3. have no use for extended data in the copy,
    4. and will just be promptly deleting the "copy" anyway,
    is it okay to use (entmake (entget...?

    I hope I'm not coming across too much like I'm second guessing everyone.
    I've just always been pretty bent on understanding in detail the things that
    I learn and use... One of these days I'll have something 'finished' that I
    can post and everyone can critique. Something just came up and I will be
    gone the rest of the day, will be looking forward to further education
    tomorrow...

    James
     
    James Allen, Jun 7, 2004
    #21
  2. John Crocco

    Joe Burke Guest

    James,

    I think, given the conditions you mentioned, the (entmake (entget... thing is OK.
    Tony and others might disagree.

    You would want to add some type checking to what you posted. For instance, was the
    object returned from (car (nentselp... contained in a block reference? An xref or a
    standard insert. Maybe like this to avoid an error if the user picks something other
    than a block reference.

    (defun c:demo (/ pick obj)
    (setq pick (nentselp))
    ;test for a transformation matrix
    (if (= 4 (length (caddr pick)))
    (progn
    (entmake (entget (car pick)))
    (setq obj (vlax-ename->vla-object (entlast)))
    (vla-transformby obj (vlax-tmatrix (caddr pick)))
    )
    (princ "\nBlock not selected. ")
    )
    obj
    )

    You are right thinking this is a very easy way to copy an object from an xref or
    block insert. Regarding the CopyObjects method with objects contained in an xref,
    that can be done using ObjectDBX.

    You are asking good questions. So keep it up.

    Joe Burke
     
    Joe Burke, Jun 8, 2004
    #22
  3. John Crocco

    James Allen Guest

    Joe, your patient help is very much appreciated. Good point about the type
    checking. Hopefully John and others will find this helpful as well.

    James
     
    James Allen, Jun 8, 2004
    #23
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.