API - MacroFeature
API - MacroFeature
(OP)
I have created a macrofeature (VBA) but I don't want to have the user insert more than one. Is there a way to check to see if the macro feature already exists? It is used in a Drawing Document.
When was the last time you drove down the highway without seeing a commercial truck hauling goods?
Download nowINTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
|
RE: API - MacroFeature
I do not have an answer, I am just thinking. What is the feature you are placing in the drawing? Does it have a unique feature that you can search for?
Bradley
RE: API - MacroFeature
RE: API - MacroFeature
I am using the macrofeature to find the last entry in the revision table and insert the information into the appropriate custom properties. PDMWorks can then interface to these custom properties. Using the macrofeature will udate the custom properties with every rebuild so that the drafter does not have to remember to run a macro or to manualy fill in the custom properties to keep them synch'd. Having more than one instance of the macrofeature is unnecessary.
If there was a way to detect an existing instance of the macrofeature then the macro that creates it would skip the part that inserts the macrofeature. I have tried to traverse the feature manager tree but have not had much luck (I'm not an expert VB programmer).
RE: API - MacroFeature
Well, the macro feature is inserted by a macro, isnt it ? Have the Insertion macro parse the feature manager tree, looking for the Feature,getType value.
If you are planning on having more than one
STYLE of macro feature in a document, but only one COPY of any STYLE macro feature, then add an attribute to the macro feature.
RE: API - MacroFeature
I have a macro that checks to see if BOMnumber is blank or a space. If it is a blank or a space then it assigns the number the file is saved as. If it is not blank or space then it is left alone. I hope this helps.
If txtSfBomNumber = " " Or txtSfBomNumber = "" Then
txtSfBomNumber.Text = DrawingNumber ' Required to show BomNumber in text box ' if new model
Else
txtSfBomNumber.Text = BomNumber
End If
Bradley