hexagon logo

IsFeature?

PT501 =FEAT/POINT,CARTESIAN
THEO/<39.8049,-1.2775,-1.5851>,<0.5235208,0.8519339,0.0116005>
ACTL/<39.8049,-1.2775,-1.5851>,<0.5235208,0.8519339,0.0116005>
MEAS/POINT,1,WORKPLANE
HIT/BASIC,NORMAL,<39.8049,-1.2775,-1.5851>,<0.5235208,0.8519339,0.0116005>,<39.8049,-1.2775,-1.5851>,USE THEO=YES
ENDMEAS/

DIM D501= LOCATION OF POINT PT501 SD=0.0000 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
X 39.8049 39.8049 0.0150 0.0150 0.0000 0.0000 ----#----
Y -1.2775 -1.2775 0.0150 0.0150 0.0000 0.0000 ----#----
Z -1.5851 -1.5851 0.0150 0.0150 0.0000 0.0000 ----#----
T 0.0000 0.0000 0.0150 0.0150 0.0000 0.0000 ----#----
END OF DIMENSION D501

PT501 is a DMIS point, not a PCDMIS vector or surface point.
Have to leave them in program and not convert to a PCDMIS point.
I have a script the tests if a Cmd is a feature.
IF Cmd.IsFeature THen
Count = Count + 1.

PT501 is detected as a feature,
but the Cmd.IsFeature is detecting another feature incrementing
the counter when I don't want it incremented.

Would it be the MEAS/POINT,1/WORKPLANE that is considered
a feature and how would I test for that and not have the counter
incremented?

Hope that makes sense!

  • Hello all,
    I just wanted to clarify something.The script I would eventually like to write would be able to re-number/rename point features in
    numerous programs. The problem is that there is a combination of pcdmis vector point which responds to IsDccFeature, and
    DMIS feature/point which responds to IsFeature. But there is something in the DMIS feat/point that additionally increments the counter as stated
    in my first Post. I can't seem to figure out what that is. Thought it might be that meas/point,1,WORKPLANE. If it is I don't know the
    best way to capture that and not have the counter incremented.

    Thanks for any help.
  • Not very impressive, but I think I got it.
    It does what I wanted.
    Had to decrease the counter when Cmd.ID was " ".
    Sorry I bothered you all Slight smile

    Count = InputBox("Enter the start number :","start number")
    feecher = InputBox("Enter the feature name :","feature name")

    For Each Cmd In Cmds

    IF ((Cmd.IsDccFeature) OR (Cmd.IsFeature)) AND (Cmd.Marked) Then
    IF Cmd.ID = "" THEN
    Count = Count-1
    END IF
    Cmd.ID = feecher + "" + STR(count)
    count = count + 1
    END IF


    Cmd.Redraw


    Next Cmd
    MsgBox "PROGRAM IS DONE"
    End Sub​
  • Hi,

    you override every id of all features... sounds a bit exaggerated, is that intentional?
    Why should a circle, a plane and a point start with the same string?

    and you can sum that up a bit
      IF ((Cmd.IsDccFeature) OR (Cmd.IsFeature)) AND (Cmd.Marked) AND (Cmd.ID <> "") Then
      Cmd.ID = feecher + "" + STR(count)
      count = count + 1
      END IF​
    
  • Thanks for your response Henniger123.
    I would only mark the point features/vector points I wanted changed.
    I the case of the programs I wanted to modify, vector points were added in certain areas,
    so the vector point feature names were changed to PT255A, PT255B, PT255C ETC , ETC.
    There might be 2000 points in the program that would intermittingly have sections
    of points added with the above type changes added. I wanted to mark all original and changed points
    and have them in numerical order.

    Also, thanks for the code change. Much more concise and elegant if I might add.
    That's the difference between an experienced programmer (yourself) and a novice (myself)

    Thanks again.
  • Correction. "In the case of the programs I wanted to modify........
  • I skipped "Cmd.Marked", you are of course right, it is only for the marked elements.

    if everything works to your satisfaction then it's good​
  • I once made a script that would order everything in numerical order by type just in case I skipped a bunch of feature name eg. PNT4... skipped a few... PNT32 the script would renumber all features with PNT[n] in order eg. PNT4... PNT5... and so on. It was a pet peeve of mine that PcDmis would throw numbers off if you created features and then deleted them (and other reasons I don't recall right now) and tried to recreate them. Unfortunately I left all that work at my last place of employment, I'm sure I can recreate it but I no longer have a seat of PcDmis handy to work on.