I was wondering if there was a way to rename features after all features have been created. I like to write my offline programs using individual Auto Vector Points and then I will build features like planes and lines (for example) after everything is created. A common problem I run into is I'll forget to put a point into a certain location. So I'll go back and insert a point where I want but since I've created 30 points after this location the new point I create will not be in numerical order. Is there a way I can tell PC-DMIS to rename all points to numerical order? Hope this makes sense. I've attached a screen shot as an example.
Once upon a time, there was a VB6 script called
EditFeat, available from the Wilcox web pages, which could do this. I can't find it on the Wilcox ftp anymore, but maybe someone else has a copy? I don't know if it would work in current Windows versions, though...
Edit: I found the VB6 source code (no executable) in my archives, and have stripped away all the VB6-isms so the script can be run in PC-DMIS Basic. It's pretty basic (pun intended), and may need a little work to do exactly what you want, but it may be a start...
I do this all of the time!
1. Go to Edit>Pattern. In this dialog box, make sure X-, Y-, and Z-offset, and Angle all =0. Number of times to offset=1. And do not mirror the features.
2. Go into the Edit Window and copy the code from your entire program.
3. Use Edit>Paste with Pattern.
This will create a copy of the entire program but will rename all of the features. Sometimes it will start the numbering sequences with the number after the last feature you copied (i.e. if the last circle you programmed was CIR6, it may start the naming sequence at CIR7 for the first feature in the duplicated code); if this happens, do it again, but this time copy the "new" code. You might need to close and reopen before copying to get it to reset the numbers to start at CIR1, PNT1, etc.
As a side note, I'm a bit confused why you want to rename everything in a program, actually why anyone would want to keep the default PLN/LIN/CIR at all.
Wouldn't it be better to give everything meaningful names from the beginning, coupled to print coordinates, balloon numbers, or anything else that has actual meaning even for the next programmer?
Anders, the reason why I sometimes run into this problem is because every feature I create in my program doesn't always have a special label like "CIR.250_1". To be honest, a lot of the time I don't even change the labels at all and just keep whatever PC-DMIS gives me. Of course, I make up for this in my reporting. When I output I put in a little extra time putting in comments above the output feature that explains the feature, whether it's a balloon number or just info like "CIR.250_1 (ZONE B4, SHEET1).
Dim PCDApp As Object
Dim PCDPartPrograms As Object
Dim PCDPartProgram As Object
Dim PCDCommands As Object
Dim PCDCommand As Object
Dim Fcntr,Vcntr As Integer
Dim FeatureList$(1000)
Dim VariableList$(1000)
Dim fType,vValue,dValue As String
Sub Part1
Set PCDApp = CreateObject("PCDLRN.Application")
Set PCDPartPrograms = PCDApp.PartPrograms
Set PCDPartProgram = PCDApp.ActivePartProgram
Set PCDCommands = PCDPartProgram.Commands
Begin Dialog DIALOGNAME1 48,60, 199, 195, "Select"
ComboBox 10,14,24,150, MyList$(), .Combo1
CancelButton 142,172,40,12
OKButton 14,172,40,12
Text 40,28,121,12, "CONTACT_CIRCLE_FEATURE"
Text 40,36,121,12, "CONTACT_CONE_FEATURE"
Text 40,44,121,12, "CONTACT_CYLINDER_FEATURE"
Text 40,52,121,12, "CONTACT_LINE_FEATURE"
Text 40,60,121,12, "CONTACT_PLANE_FEATURE"
Text 40,68,121,12, "CONTACT_SLOT_ROUND_FEATURE"
Text 40,76,121,12, "CONTACT_ANGLE_POINT_FEATURE"
Text 40,84,121,12, "CONTACT_SLOT_SQUARE_FEATURE"
Text 40,92,121,12, "CONTACT_SPHERE_FEATURE"
Text 40,100,121,12, "CONTACT_VECTOR_POINT_FEATURE"
Text 40,108,121,12, "CONST_SET"
Text 40,116,121,12, "CONST_MID_LINE"
Text 40,124,121,12, "CONST_WIDTH2D_FEATURE"
Text 40,132,121,12, "CONST_WIDTH3D_FEATURE"
Text 40,140,121,12, "VISION_SURFACE_POINT_FEATURE"
Text 40,148,121,12, "VISION_CIRCLE_FEATURE"
Text 40,156,121,12, "VISION_LINE_FEATURE"
End Dialog
Dim Dlg1 As DialogName1
Dlg1.Combo1 = "Selection"
button = Dialog( Dlg1 )
If button = 2 Then
Quit
End If
Select Case Dlg1.Combo1
Case 612
fType = CircleName
Case 615
fType = ConeName
Case 616
fType = CylinderName
Case 614
fType = LineName
Case 617
fType = PlaneName
Case 618
fType = SlotName
Case 605
fType = AngleName
Case 619
fType = SqSlotName
Case 613
fType = SphereName
Case 602
fType = PntName
Case 596
fType = SetName
Case 544
fType = MidLineName
Case 586
fType = WidthName
Case 587
fType = WidthName
Case 241
fType = VisionPointName
Case 245
fType = VisionCircleName
Case 243
fType = VisionCircleName
End Select
I rename features this way all the time, but wonder if special characters I use are a good Idea, for example I will use "Ø3.500 OD" for a feature label
Is there a way to take the above code and modify it to not rename but to capture and output dynamically named features to a csv? I'd envision using the popup dialog and using it to select the features that will be used with a writeline. Whatever is selected is then exported with the feature name, measured x, y, z, etc.
This is absolutely doable, but unfortunately I didn't find a finished script in the forum.
You must enter your code after "FeatureList(Fcntr) = PCDCommand.ID" which extracts the data and then writes it in a csv/txt file