Skip to main content
1-Visitor
July 22, 2011
Question

Can you delete specific object info?

  • July 22, 2011
  • 2 replies
  • 2440 views

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?

    2 replies

    12-Amethyst
    July 22, 2011

    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.

    Syntax

    DELETE OBJECT_ATTRIBUTE

    β€œname” element

    name

    Defines the name of the attribute that has to be removed.

    element

    Defines the element.

    Example

    DELETE OBJECT_ATTRIBUTE "Stock" el

    .

    TimSharp1-VisitorAuthor
    1-Visitor
    July 22, 2011

    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?

    12-Amethyst
    July 22, 2011

    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).

    1-Visitor
    July 22, 2011

    Hi Tim,

    You can lock the items with existing partnumbers and then use DELETE OBJECT_INFO DEEP.