Search code examples
vb.netcatia

CATIA Macro "Any geometry infinite"


I am trying to measure distance between a line and a point using below code.

ptref = Partdocument.Part.CreateReferenceFromObject(pt1) 'creating reference from point
    refline = Partdocument.Part.CreateReferenceFromObject(line1) 'creating reference from line

Get measure

 TheMeasurable = TheSPAWorkbench.GetMeasurable(refline)
    dist1 = TheMeasurable.GetMinimumDistance(ptref)

since line and point are at different plane, I am not getting the required output. I want to to measure using "Any geometry, infinite option".

Please suggest how I can incorporate that.


Solution

  • That is not supported using the SPAWorkbench/Measurable.

    As a workaround, it is not difficult to get the end points of the line and perform the calculation using vector algebra.