hexagon logo

extraction type of feature

Hello, I do need extract types of features used for 2d/3d dimensions. As per program example below:

{DIM DIST8B= 3D DISTANCE FROM PLANE PLN1 TO CYLINDER CYL4,SHORTEST=OFF,NO_RADIUS UNITS=MM,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
AX NOMINAL +TOL -TOL MEAS MAX MIN DEV OUTTOL
M 1.433*1 0.55*1 0.2*1 1.433 1.433 1.433 0.000 0.000 --#-------
FCFPROF3 =SURFACE PROFILE : PLN1}

Here is distance between PLANE and CYLINDER. Any ideas how to extract types of features?

P.S. I do have code which working without type of features, problem is that execution of script doing a lot of scan and it taking far too long. My goal is to execute code only if code is relevant with type of feature.
Parents
  • Personally I have done it by looping through the program and build up a table containing references to all features in the program. When I need data for a feature I just look it up in the table and call the command.type function. It will give you an integer, there is a list in the documentation regarding that. You should be aware that the type is usually rather specific, there are for instance a bunch of different cylinder feature types. (Including constructed features. Which may have different internal representations, watch out if extracting data from cylinders, hits are fine though in my experience.)
  • Problem with TYPE of feature I did solve by using first 3 letters of feature ID. It do work good enough, just need to ensure that default feature ID will stay the same. TYPE I needed to ensure that will be executed only part of code related with certain type of feature.

    Problem with time of execution I did solve by exporting data of features to table in excel (looping) and then looping trough basic dimensions and searching for data in table by REF_ID. Seems like I'am done in similar way as you did.
Reply
  • Problem with TYPE of feature I did solve by using first 3 letters of feature ID. It do work good enough, just need to ensure that default feature ID will stay the same. TYPE I needed to ensure that will be executed only part of code related with certain type of feature.

    Problem with time of execution I did solve by exporting data of features to table in excel (looping) and then looping trough basic dimensions and searching for data in table by REF_ID. Seems like I'am done in similar way as you did.
Children
No Data