Can I automatically save a part using custom properties? Like, "PartNo" - Description.sldprt
(This doesn't work:
\\\$PRP:"PartNo" - \\\$PRP:"Description".sldprt)
Thanks!
SolidworksGeneral
Can I automatically save a part using custom properties? Like, "PartNo" - Description.sldprt
(This doesn't work:
\\\$PRP:"PartNo" - \\\$PRP:"Description".sldprt)
Thanks!
SolidworksGeneral
I don't know how it is done, but I believe it could be done with a macro.
SWit has this feature
http://www.sloworks.fi/shop/product.php?id_product=18
br
Markku
It looks useful, but I can't download or install anything on the computer I'm working on. Thanks though. Any macro expert out there?
The thing I can think is via macro and then you need to use the macro to save the file first time. Let me check my macro codes basket
It's already here: Save As File name based on custom property
Thanks Deepak, acn you walk me through it? I'm not a macro guy.
My custom properties look like this:
So does "Number" become "PartNo", etc?
Yes and then we combine it with description in the macro.
This is quick code you can test (since I don't have SW installed). This macro will save the part in the active working directory. In case you need to be able to specify a location, the codes needs to be modified. Also this one will overwrite any existing part with same name and will not prompt so be careful.
<p></p><p>Sub main()</p><p>Dim swApp As SldWorks.SldWorks</p><p>Dim swModel As SldWorks.ModelDoc2</p><p>Dim PartNo As String, Description As String </p><p></p><p>Set swApp = Application.SldWorks</p><p>Set swModel = swApp.ActiveDoc</p><p></p><p>PartNo = swModel.CustomInfo("PartNo")</p><p>Description = swModel.CustomInfo("Description")</p><p></p><p>swModel.SaveAs (PartNo + "-" + Description + ".sldprt")</p><p></p><p>End Sub</p>That's perfect, thank you!