Welcome to SolidWorks forums Rob.
Since this is an API question, please move it to API section. Use move discussion option on the right side.
BTW check this solution here and modify per need: https://forum.solidworks.com/message/251806#251806
You might also find this post helpful for your future reference.
it is possible u have to just get particular custom property.
Type get2 in API help and see given examples.
Any doubt please ask.....
I have tried to execute this macro but, I have a problem. I want to use the PartNo property of the model in the drawing, not the PartNo property of the drawing. Besides, I have several configurations in the part file so I need the PartNo property of the active configuration in the drawing. How is it made?
First thing you need to do is grab a view from your drawing. Then you can get the referenced configuration from that.
Then you can get the CustomerPropertyManager from that config.
Then you can get the property value.
According to me with Enrique... active doc will be drawing doc so for that how we will get custompropertymanager to that and ReferencedConfiguration is a property not a class so i think
view.ReferencedConfiguration.CustomPropertyManager wont come ..am i right...or got wrong..?
Hi Enrique i got something..u just try with
Set swDrawModel swView.ReferencedDocument
where Dim swDrawModel As SldWorks.ModelDoc2
then for this u can retrive anything ...
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim ConfigProperty As String
Set swApp = Application.SldWorks
Set swDraw = swApp.ActiveDoc
Set swView = swDraw.GetFirstView
Set swView = swView.GetNextView
Set swModel = swView.ReferencedDocument
ConfigName = swView.ReferencedConfiguration
ConfigProperty = swModel.CustomInfo2(ConfigName, "PartNo")
swDraw.SaveAs (ConfigProperty + ".PDF")
Thank you so much for your help.
Hello Deepak Sir,
Your above code works very fine for me as well. Thank you.
In my case I want to save 8 configuration of drawings into 8 different PDF.
Can you please let me know how to extend your code to fulfill above requirement.
Hello Deepak Sir,
Work very perfectly.
Thank you for taking out time & supporting.