first 22 characters of filename

Hi, How can i write first 22 character of part filename in drawing title? For example;

solid file name --> 40-06-01-11-00-5-01-01_sag_motor_destek_parcasi.sldprt

in drawing title --> 40-06-01-11-00-5-01-01

is it possible without write a macro?

Not: please look at the attach.

SolidworksApi macros
Answers 4
DG
DG 2011-01-13 Best Answer

Welcome to SW forums Burak

The only way will to write a macro which can be inserted in the part template (in part properties) and then all your files will have the Part No set to 22 characters of filename.

Also read this post for your future reference: Forum Posting

JB
JB 2011-01-13

https://forum.solidworks.com/thread/31085?start=15&tstart=0 is the same question with a lot of explanation of how to do what Deepak suggested.

SF
SF 2011-01-13

Thanks, he asked the same question. I'll read the topic.

DG
DG 2011-01-13

And in case you need the property to be configuration specific, just modify the code and add the configuration name.

"dummy"= part.Extension.CustomPropertyManager(add the configuration name here).Set("partno", Left(part.GetTitle, 22))