xentselx + vlax-curve-getclosestpointto

Discussion in 'AutoCAD' started by John Uhden, Aug 5, 2003.

  1. John Uhden

    John Uhden Guest

    Okay, the WCS2OCS thing is hopefully working, BUT:

    I still have this annoying problem with the fact that the (xentselx) functions
    return the pick point without any meaningful Z value. I've complained about
    this before. Suppose you want to pick a segment of a 3DPolyline (nested or
    not). An (osnap pt "_quick,_near") might find a point on another nearby object.
    A (vlax-curve-getclosestpointto) might find a different segment because the
    distance is affected by the Z values.

    Example:
    Command: (command "_.3dpoly")(mapcar 'command '((0 0 100)(10 10 110)(20 20 120)
    ""))
    _.3dpoly
    Specify start point of polyline:
    Specify endpoint of line or [Undo]:
    Specify endpoint of line or [Undo]:
    Specify endpoint of line or [Close/Undo]:
    Command: (nil nil nil nil)

    Command: (setq pick (nentselp '(14.99 15.01)))
    (<Entity name: 400b7de8> (14.99 15.01 0.0))

    Command: (setq object (vlax-ename->vla-object (entlast)))
    #<VLA-OBJECT IAcad3DPolyline 025f6904>

    Command: (vlax-curve-getclosestpointto object (cadr pick))
    (0.0 0.0 100.0)

    Anyone care to propose a solution to getting the correct point?
     
    John Uhden, Aug 5, 2003
    #1
  2. Perhaps using the appropriate tool for the job
    might work:

    vlax-curve-GetClosestPointToProjection
     
    Tony Tanzillo, Aug 5, 2003
    #2
  3. John Uhden

    James Buzbee Guest

    Hey John, here's a thought - have you tried using
    vlax-curve-GetClosestPointToProjection?

    jb
     
    James Buzbee, Aug 5, 2003
    #3
  4. John Uhden

    John Uhden Guest

    Thank you kindly, Tony/James. Why did I never see that one before!? Now I'm a
    little daunted by what 'Normal to use when the object is nested... the nested
    object's normal? it's parent's normal? or just plain '(0 0 1)?




     
    John Uhden, Aug 6, 2003
    #4
  5. John Uhden

    Doug Broad Guest

    John,
    If you are worried about what point the pick point appears close to then I
    would imagine you would need the normal of the DCS.

    (trans '(0 0 1) 2 0)
     
    Doug Broad, Aug 6, 2003
    #5
  6. John Uhden

    John Uhden Guest

    Thanks, Doug. I expect a little experimentation is in order. But with the
    usual collection of brains contributing, we may be able to nail it down. Tony
    is probably the most capable of unraveling the mysteries, but I wish Jon Fleming
    would participate a little more. I sorta think of him as the transformation
    meister. Then again, it was Larry Leuallen who unraveled the inverse matrix
    method.

    Just an aside, but are the regulars maybe getting bored of this scene?
     
    John Uhden, Aug 6, 2003
    #6
  7. John Uhden

    Doug Broad Guest

    Hi John,

    Just pretty busy. I try to participate when its of interest and
    I don't think its going to take hours. A lot of the questions
    lately haven't been all that interesting. There have been a
    lot of folks looking for handouts without much real learning
    happening.

    I am curious why the trans function hasn't come up in a
    few of these threads or why the getucsmatrix and transformby
    methods haven't been discussed. Transforming points is one
    thing but drawing entities normal to another ucs seems to
    require different strategies IMO. Course I could be getting
    past it.

    Seemed like the discussions a year ago were much more
    alive with people learning the new methods.

    Thanks for keeping the level of the discussion up! I imagine
    there are still lurkers out there who are benefitting.

    About inverse matricies, I'm afraid the concepts probably
    did not originate with Larry or Jon, although they may have posted
    the earliest AutoLISP ones. I didn't check the newsgroups till 2 years ago.
    I remember reading about 3d transformation using matricies
    when I was in college(long before AutoCAD). I had to
    program my own CAD system circa 1980 on a Textronix terminal
    using the campus IBM 360 and the APL language to draw my thesis
    project. APL is marvelous for that stuff. I was able to design
    and draw an amphitheater for 5000 and show and plot the drawings
    in isometric section and plan.

    Regards,
    Doug
     
    Doug Broad, Aug 6, 2003
    #7
  8. John Uhden

    John Uhden Guest

    Wow! Now my dreams tonight will be 4-dimensional! ((Z Z Z Z)(Z Z Z etc.))
     
    John Uhden, Aug 6, 2003
    #8
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.