-
Re: Macro to save jpg of iso view
Jerry Steiger Jun 8, 2010 6:30 PM (in response to John Lindemann)John,
If you haven't already done so, you might want to post this in the API forum. I think that's where the guys who could help you the most with this lurk. (At least I think so; I have never gone there myself, being highly averse to trying to program SW.)
Jerry Steiger
-
Re: Macro to save jpg of iso view
Deepak Gupta Jun 9, 2010 3:37 AM (in response to John Lindemann)John, I'm not that good at writing macros but try the attached one (can be further modified).
Macro will find all the part files in the specified Path/location, rebuild & save JPG images (Isometric View) in the same location.
-
Re: Macro to save jpg of iso view
Greg Hynd Jun 9, 2010 3:44 AM (in response to Deepak Gupta)I use this one, but you have to run it on each part. someone might be able to modify it. i have set it up to a keyboard shortcut.
-
SaveAsJPG.swp.zip 6.0 KB
-
-
Re: Macro to save jpg of iso view
John Lindemann Jun 9, 2010 11:17 AM (in response to Deepak Gupta)Deepak,
Thank you for sending this. It works very well and is close to what I need but I'm trying to tweak it a little more...maybe you can help me.
- I like how it asks for a source folder but I need it to also ask for a destination folder. My destination folder will always be the same so it could be hard coded into the program.
- Also, I need to be prompted (or better yet...hardcoded) to add a prefix to the file name.
- I need the file name to be based on the Custom Property Part number.
- I edited your code to also look for .sldasm files, I can send that to you if you want.
Deepak -- I've read a lot of discussions and questions that you have answered, thank you for all your help.
-
Re: Macro to save jpg of iso view
Deepak Gupta Jun 9, 2010 2:49 PM (in response to John Lindemann)John, I had made that macro for a different purpose and then slightly modified it just to check if this suits your application. All the things you need to modify in the macro are doable.
-
Re: Macro to save jpg of iso view
Deepak Gupta Jun 10, 2010 10:51 AM (in response to John Lindemann)Try this one (still work on parts only but can be modified)
Few changes to be done:
1 Change the required custom property
2 Change JPG image save as path
3 Change the Prefix
-
Re: Macro to save jpg of iso view
John Lindemann Jun 15, 2010 11:01 AM (in response to Deepak Gupta)Deepak,
I have some code that I'm happy with but I would like to change it a bit and I can't figure out how. Currently the macro is pulling the part number from the custom property of the default configuration. It works great but...I would like it to pull the custom property from the active configuration, regardless of whether it is the default configuration or not. The below code is the line I believe needs to change.
fName = "K:\John L\" & prefix & swModdoc.GetCustomInfoValue("Default", "PartNo")
-
Re: Macro to save jpg of iso view
Deepak Gupta Jun 16, 2010 6:05 AM (in response to John Lindemann)John, I'm sure you need config specific property and not custom property (please confirm)
Custom property is general to the file, in which case there is a single value whatever the model's configuration
Configuration-specific, in which case a different value may be set for each configuration in the model
-
Re: Macro to save jpg of iso view
John Lindemann Jun 17, 2010 11:22 AM (in response to Deepak Gupta)You are right, I need configuration specific. I need the macro to pull the configuration specific part number from the active configuration...not necessarily the "default" configuration.
Thanks
-
Re: Macro to save jpg of iso view
John Lindemann Jun 23, 2010 10:31 AM (in response to John Lindemann)Is there a method to pull "configuration specific" custom properties from the active configuration? I need it to pull from the active config, regardless of whether it is the default or not.
I attached my macro:
-
Re: Macro to save jpg of iso view
Deepak Gupta Jun 23, 2010 11:02 PM (in response to John Lindemann)John, I have been trying my hands on it but no being an API guru, I haven't reached anywhere yet.
-
Re: Macro to save jpg of iso view
John Lindemann Jun 24, 2010 8:17 AM (in response to Deepak Gupta)I've been trying too...no luck yet. I did find out that capitilization matters though! "default" will not call "Default"
Thanks for your help, I really appreciate it.
-
Re: Macro to save jpg of iso view
Filipe Venceslau Jun 24, 2010 9:30 AM (in response to John Lindemann)Hi, John.In a previous thread you mentioned the following line of code:
fName = "K:\John L\" & prefix & swModdoc.GetCustomInfoValue("Default", "PartNo")
If you want to retrieve the configuration specific property for the active configuration instead, then you have to replace "Default" with the name of the configuration you want the property from, in this instance, since swModdoc is an IModelDoc2 object, then you can use the following code:
fName = "K:\John L\" & prefix & swModdoc.GetCustomInfoValue( swModdoc.ConfigurationManager.ActiveConfiguration.Name, "PartNo")
Next time, please post in the appropriate forum, your question will be addresses much quicker.
Cheers
-
Re: Macro to save jpg of iso view
Deepak Gupta Jun 24, 2010 10:22 PM (in response to Filipe Venceslau)Thanks Filipe for making the life easier. I have been trying to use the same codes (swModdoc.ConfigurationManager.ActiveConfiguration.Name) but what not sure how to use them.
-
Re: Macro to save jpg of iso view
Filipe Venceslau Jun 24, 2010 10:43 PM (in response to Deepak Gupta)That's what we're all here for... to help one another make their job/life easier.
Cheers
-
-
-
-
-
-
-
-
-
-
-
Re: Macro to save jpg of iso view
Deepak Gupta Nov 15, 2013 5:22 AM (in response to Davif Dsdas)Can be a missing library/reference. Try this updated macro (fixed and tested for SW2013)
-
-
