hexagon logo

Find nearest cad element

Hello all,

Is there a function in the object library that you can use in a script
that can "find the nearest cad element" for vector points? (for example)
Any help will be appreciated. Thanks.
  • There is a tool in PC-DMIS that can find nearest CAD element for point features. Edit>Graphics Display Window>Point Nominal Deviation... It doesn't work for edge points, but neither does Find Nearest CAD Element.
  • You mean something like the right-click menu choice "Feature -> Update Nominals from CAD..."? I know no way to automate that...

  • Thanks for the responses.
    I should have elaborated as to why I was looking for that
    magic function. Not having much "scanning experience",
    I wanted to probe an exact .250 (inch) grid on a contoured
    surface with an exact starting point and an exact .250 increment.
    I did the first two rows with vector points and manually adjusting
    the exact increment with the F9 "binocular icon find nearest cad
    element". Then I did a paste with pattern and generated another
    90 or 100 points, but had to project them onto cad surface
    with the "find nearest cad element" individually.
    I tried the grid scan but could get the exact start point.
    So I thought there might be a function that would automatically
    project the generated points onto cad surface in a script.
    But, if there is an easier way to get the grid scan to do that,
    I'm open to that. But I guess that should be posted in the
    CMM part of the forum, not the CODE SAMPLES.
    Thanks again.
  • git, Point Nominal Deviation does exactly what you want, and it will do every point at the same time.
  • I did a quick test, and it looks like the option "Change manager -> CAD" (part of PC-DMIS Planner?) also does the trick (and works for all kinds of features). I layed out a number of points "in the air" above a curved surface, then started the Change Manager and set a quite large tolerance for locating differences between CAD and program (too small tolerance and everything goes into the "possibly delete?" list), selected all found points and did an Update - Bingo! Most of them were now on the surface (I don't really understand why not all of them)!

  • Thanks for the responses.
    I should have elaborated as to why I was looking for that
    magic function. Not having much "scanning experience",
    I wanted to probe an exact .250 (inch) grid on a contoured
    surface with an exact starting point and an exact .250 increment.
    I did the first two rows with vector points and manually adjusting
    the exact increment with the F9 "binocular icon find nearest cad
    element". Then I did a paste with pattern and generated another
    90 or 100 points, but had to project them onto cad surface
    with the "find nearest cad element" individually.
    I tried the grid scan but could get the exact start point.
    So I thought there might be a function that would automatically
    project the generated points onto cad surface in a script.


    On a side note, (not for automation programming)
    You could use F5/ Find Nominals during Execution, once.
    Run offline, it'll move every (Snap On) Vector point in your program to the closest CAD nominal.
    There's a long write up on the other forum.

  • Thanks all for the variety of answers to my post.
    It lends credence to the old saying "there's more than one
    way to skin a cat".
    Additional lesson learned for me is that I need to
    explore/experiment with the available PCDMIS
    functionality and not try to re-invent the wheel with
    a script.
    Although I must say, some of the scripts posted on this
    site are pretty awesome. Thanks again!!