I have a few macros that add infos to objects to aid selecting them later in the macro.
At the end of the macro, I use the DELETE OBJECT_INFO DEEP command to remove these infos so the items changed in the macro are not changed again next time the macro is run on a different part of a drawing.
Trouble is, that the DELETE OBJECT_INFO DEEP command removes all infos on everything, meaning that infos cannot become permanent parts of drawing objects.
I would like to be able to be able to have infos (for existence part numbers) attached to drawn items so that you can run macros to select them later, but to do this I would have to start removing specific infos, leaving on the ones that are meant to be permanent.
Is there a way to do this?
This would be a good use of Select if. You can grab all the objects that you applied your attribute to by selecting by attribute or attribute value. Then loop through to remove that attribute.
Here is the verbiage from the manual for removing a specific attribute.
Defines the name of the attribute that has to be removed.
Defines the element.
DELETE OBJECT_ATTRIBUTE "Stock" el
Thanks again Trevor
I was looking for a delete command that used info in it's name, so I missed the object_attribute one!
I didn't realise that you have to create an object info before you can add an object attribute.
Will this work through grouped items?
I was hoping you wouldn't ask. It will work in groups, but I am unsure how it will work if you have an attribute on the group level as well as within the group. You may end up having to run select and run the loop to delete until there are no more elements when you use the select if command (hope that makes sense).