It is possible to make the dialog box stay open while you are doing other things in Inventor. This requires some code changes to make the dialog work non-modally. You would move the code to assign the iProperty values from your rule to the dialog. Then use the function dlg.Show instead of dlg.ShowDialog. You should also add an event handler to the dialog so that the dialog will close if the document is closed.
What version of Inventor are you using?
> how about it if I put it on a different layer that could be turned on and off?
I tried that (in Inventor 2011). I could turn the text in a Sketched Symbol off, but not the lines (sketch geometry). If you can get this to work manually (make your entire symbol invisible by turning off the layer) please let me know. You can turn off a layer using a rule function such as:
ThisDoc.Document.StylesManager.Layers("Symbol (ANSI)").Visible = False
> I have tried to tell it to put a X in the custom iproperty this works but it doesnt always turn off the X when a different status is selected.
You should be able to fix it by changing the last part of your rule to:
'AS-BUILT FOR RECORDS STATUS'
If DLG.VBSTATUS= "AS-BUILT FOR RECORDS" Then
iProperties.Value("Custom", "AS-BUILT FOR RECORDS")="X"
Else
iProperties.Value("CUSTOM", "AS-BUILT FOR RECORDS")=""
End If
'PRELIMINARY SKETCH/INFORMATION ONLY'
If DLG.VBSTATUS= "PRELIMINARY SKETCH/INFORMATION ONLY" Then
iProperties.Value("Custom", "PRELIMINARY SKETCH/INFORMATION ONLY")="X"
Else
iProperties.Value("Custom", "PRELIMINARY SKETCH/INFORMATION ONLY")=""
End If
'SUBMITTED FOR CUSTOMER APPROVAL'
If DLG.VBSTATUS= "SUBMITTED FOR CUSTOMER APPROVAL" Then
iProperties.Value("Custom", "SUBMITTED FOR CUSTOMER APPROVAL")="X"
Else
iProperties.Value("Custom", "SUBMITTED FOR CUSTOMER APPROVAL")=""
End If
'SUBMITTED FOR CUSTOMER CERTIFICATION'
If DLG.VBSTATUS= "SUBMITTED FOR CUSTOMER CERTIFICATION" Then
iProperties.Value("Custom", "SUBMITTED FOR CUSTOMER CERTIFICATION")="X"
Else
iProperties.Value("Custom", "SUBMITTED FOR CUSTOMER CERTIFICATION")=""
End If
'CERTIFIED FOR FABRICATION'
If DLG.VBSTATUS= "CERTIFIED FOR FABRICATION" Then
iProperties.Value("Custom", "CERTIFIED FOR FABRICATION")="X"
Else
iProperties.Value("Custom", "CERTIFIED FOR FABRICATION")=""
End If
Also, you can get rid of the End If at the end of the rule by changing the line:
If (i=vbOK) Then
to
If (i <> vbOK) Then Return
This will Return (exit from the rule) if i is not vbOK.
I would recommend keeping the code that I send to make the symbol invisible in a separate rule. (Unless we can make the method of turning the layer on and off work. In that case the code would be simpler.)
If you use the code I send as a separate rule, you can trigger it by creating a True/False (Boolean) parameter named SymbolOn, and setting the value of this parameter to True or False in your dialog rule. I'm not sure under what conditions you don't want to show the symbol.
Mike Deck
Software Developer
Autodesk, Inc.