Thanks for replying. I have tried that method in my attached file and it works well but shows as an error which isnt ideal. I would be using many of these in assemblies so I wouldnt want them all to show up with an error. I have read that this was an issue after SW 2015 with Windows update KB3072630 but cant seem to fix it after following the advice.
Does my attached part template work for you without showing an error? If I could get my SW to now show them with an error this method would be just as acceptable as the macro feature. Thanks
Plate with Error.prtdot.zip 39.5 KB
The rebuild error what u have identified is prevalent as this has not been considered as a proper method in recent releases.
It occurs for me even.
Check the following link to do it other way.
Solidworks Addin can do a great job. Where you could write API to capture the rebuild event and can use it to do any operations you want.
To be honest I didn't fully understand those methods in the link so wasn't able to set it up to auto-run my attached macro.
I know you didnt mention them but would I be right in saying that macro features must be the last feature and so it wouldn't be useful/possible to use them in a template in which more features will be added?
Is there therefore no way to have a part template that is capable of running an embedded macro on each rebuild without referencing other files or opening SW through a special manner? I'm just thinking of sending the parts to other users etc. Thanks again for your help.
Hi Kyle ,
May be what you can do is that by equations you can run a macro as you are doing it already.
Then the macro will suppress the equation ,(To avoid the rebuild error)
Finally rebuild event written in the macro will be running automatically by default and will gives you the desired functionality
If any help needed,feel free to ask.
I have a little experience with macrofeatures. I have a whole design suite written that is models that are only macrofeatures.
Let's get started. What do you want it to do?
Create a website?
Delete files from folders?
Turn lights on and off?
Call your parents?
Update a variable in a database?
Update a property in a file?
Probably none of these but these things can literally be done with a macro feature
Lay out your requirements. I cant see your file from my phone.
Hi Jacob, thanks for replying. Glad to hear they can do so much!! I still don't fully understand them, however I'm not sure they can manage what I would like. I have attached a part template which has a macro embedded that updates a custom property (the amount of bends a sheet metal part has). I need a method to have this run every time the model is rebuilt. The part template has no features yet though, as I need to create each part from scratch. My understanding now is that no more features can be added after a macro feature? So would I have to keep re-adding the macro feature to the end of the tree which defeats the purpose of automating the process as I may as well just rerun the embedded macro. I have managed using equations but get it says there is an error in the part which is no use for us.
Any insight would be greatly appreciated. Thanks again
Plate.prtdot.zip 37.3 KB
Not true. I have parts with many hundreds of macro features in them. You can have a macro nature always be at the end but it won't restrict future features.
Instead of a macro nature for what you are doing, you will want to register for events as Abilash V. Stated above.
Macro feature are a final resort to something you cannot get to work. Trust me they can be a pain in the butt.
Either write a silly addin that registers to regennotify, launch sw in a macro mode using start in as stated above.
A macrofeature requires that someone inserts it and doesn't delete it to work.
Events always execute.
So avoid macrofeature like the plague unless you want to take full control of a specific thing.