cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Does anyone have a custom macro to remove object tip information from objects?

jhasselbring
1-Newbie

Does anyone have a custom macro to remove object tip information from objects?

Hi there,

we have a bunch of 2d and 3d graphics that have "object tips" in the Objects.  We only need to remove the object tip (the hovering text) part.

Is there an existing custom macro for that or is there a batch process technique?   I would like to streamline the process for efficiency.

Any ideas?

kr

Janine

9 REPLIES 9

Made an assumption. Please correct if wrong. You can't actually delete 'object tips' as it is a built-in field (well, technically you could by some in-depth customizations but I digress). So I'm assuming you just want the value set to null for this field. The following macro should do this. Not it does this at the top level. What I mean is that if you have a group with an object tip it will clear that. But if you have additional object tips within that grouping it does not go that far. Possible, but it gets much more complicated.

Macro Remove_Object_Tips

    #Declare variables

    Define el as Element

   

    #Clear existing selection.

    Select None

   

    #Select all objects with object tips populated.

    Select if Object_tip is not equal to ""

   

    #Loops through objects removing object tips.

    el = ActiveDoc.firstSelectedElement

   

    While(exists(el) = True)

        el.info.tip = ""

        el = el.NextSibling

    End While

   

    #Clears selection.

        Select None

End Macro

Thanks Trevor, but it didnt work for 3D embedded Object information tips that are embedded...any other ideas?

Thanks so much, Janine Hasselbring

It did work great for the 2D object tip removal though

This seems to work well:

Macro v2_Remove_Object_Tips

    #Declare variables

    Define el as Element

   

    #Clear existing selection.

    Select None

   

    #Select all objects with object tips populated.

    Select if Object_tip is not equal to ""

   

    #Loops through objects removing object tips.

    el = ActiveDoc.firstSelectedElement

   

    While(exists(el) = True)

        el.info.tip = ""

        el = el.nextSelectedElement

    End While

   

    #Clears selection.

        Select None

End Macro

I'm going crazy. What's the difference between that one and the one I posted?

I pulled in a prt file, added an Object tip and then ran the macro and it cleared out so I'm not sure why it's not working for you. Are the elements within a group or...?

Do you have a simple 3D file you could provide as a test case?

we replaced "nextsibling" with "nextSelectedElement"  under the "While..."

we had objects that are nested within other objects...

Ah. Missed that difference and nice catch. Glad you got it working.

Top Tags