How to display in the balloons only the last 3 digits of part names.

How to display in the balloons only the last 3 digits of part names. ie .: I have the names of parts: a200b300-01-001, a200b300-01-002, a200b300-01-003 and need only show in balloons 001, 002, 003. Is it possible to do this? I use SW 2014 sp. 5.0

SolidworksApi macros
Answers 9
DG
DG 2015-03-26 Best Answer

Here is one method which is not using API.

Simply create a new property in the part and add the required value there. Now set the balloon to refer to that value.

MH
MH 2015-03-26

I don't want create a new property. it's too much work to do and too many parts.

DG
DG 2015-03-26

A macro can be easily created for adding the property with required value. This would be rather easy when using the same parts again.

MH
MH 2015-03-26

Can you write me such macro? because I can not . It would be very helpful.

DG
DG 2015-03-26

OK, will try to write that soon.

MH
MH 2015-05-14

hello

do you wrote the script?

DG
DG 2015-05-15

Sorry almost most skipped that. Attach is macro you can test. It would work on active file.

It will create a custom property named Balloon No. with value as last 3 digits from the file name.

KC
KC 2015-05-18

Hello all,

Instead of using a macro for this, I used a design table with a custom property "Last3", which is automatic if the table is part of the SW file.

You can use this property in a saved dedicated balloon or add it as a BOM column to reduce clutter.

It uses Excel's RIGHT() function (specifically: "=RIGHT(A1,3)") to extract the last three letters from the filename.

Since the filename is added to the title "Design Table for:...", RIGHT() points to this cell and the $prp@Last3 result cell has the last of the filename.

Remember, the design table "Last3" property shows up in the Config specific properties, not in the global custom properties.

I hope this helps.

Cheers,

Kevin

MH
MH 2015-05-19

Hello

That Macro from Deepak work perfectly.Thank you very much. I owe you a beer Deepak