How can I automatically add the perimeter of a part in its custom properties? I know I can measure it and have it in a sensor but I need it in a custom property to have it in a general BOM. I need it to update when I modify the part.
Here is the modified macro and ini file.
Check if this helps: Adding Sketch length to Part properties
It sort of helps. But it takes too long to do this to for every part in my assembly. I have a few hundred parts and it would take too long to do this to every part sketch. I was hoping it could be done like measuring with the sensor. Or with a custom property like the surface area.
Well it would depends on the shapes of the components.
The attached macro is what I use to use to calculate mass/meter, area, total perimeter , external perimeter and anodising perimeter of an extruded aluminium profile. You would have to select the face of the profile first and then run the macro. Please note the macro and ini file has to be saved in the same location. The macro would save the above info as custom properties in the part. This info would propagate to your drawing if the custom properties are setup in your drawing template as well. Please note that the info does not update automatically if changes are made to your part. You would have to delete the custom properties and then rerun the macro.
Thanks. This is great but I need only the "Total_Perimeter" property from your macro. I tried to edit it but I can't. Could you please change it to save only the "Total_Perimeter" property for a part?
And also please leave in the "Section_Area" custom property. That helps me out too.
Thanks a million! This is exactly what I need.
This macro is great & could save me some time if it was in inches instead of metric. Is that possible? I only need the total perimeter & external perimeter.
Macro modified to inches. Please test to check if output values are correct.
Yes the values are accurate. Thanks so much for your help.
i tried this macro out. it works great as others have commented. Are you able to provide the same macro as your original with all of the parameters but in inches instead of metric? i would try to edit the original but as others have also mentioned it is locked and i cannot access it. Thanks in advance
Here is the original macro.
Thank you for your help. this is great work and very much appreciated.
This is the error I get when I try to run your macro
I am assuming you are adding a macro button to your toolbar. In this case you need to change the method to FaceProperties1.main. this should solve your issue.
No I didn't add it yet or even attempt to add it
my guess then is you have not included the ini file into the same folder. suggest to read the entire string. Since i needed the macro sooner than Feroz was able to provide it i ended up using one of his open macros he provided above and modified it along with modifying the ini file. i am not sure how to upload it here or i would. however, i will also mention that my macro it set up a little different where i am not using the anodizing perimeter or the extrusion factor so if you need those my macro would help you and unfortunately right now i do not have the time to figure out the further modifications.
I have both in the same folder, side by side holding hands
did you pair the swp and ini files that were uploaded together? if you chose an swp file from on instance of them being uploaded and then used an ini file from a different time the files were uploaded likely will no be compatible. the swp file uses information from the ini file and you may need to modify the ini file to match the requirements of the swp file. hope this makes sense
I have a bit problem with this one. Its literally what i need, but I think, im setting INI file wrong.
If i use only macro on face, it shows me small table with answers, but if i download INI file as well, nothing happens.
What i should do in custom properties table ?
Hi Feroz, Would you please upload the [inch] surface area and perimeter macro along with the .ini file? I've read the string but I can't get the [inch] area and perimeter macro to work. Also, is it possible for this macro to create another custom property which calculates the number of holes within the surface? Thanks for any help.
Attached are modified files as per request .Unfortunately, I cannot assist with calculating the number of holes as I am not clued up with writing macros. The macro was created for me by a good soul in this forum called " SolidAir".
Works very well , thank you.
I have a couple of thoughts on this. I love the macro's idea. I've been having some issues with it. I wanted to edit it and make it output both metric and english units as well as find a circle size among other small edits. The challenge is that every time I modify the open macro (the english unit one with no mass/meter unit) it crashes on me. Also, occasionally, my virus protection will snag the script as malicious and I get a DLL entry point error. So, if that happens to you too, then check that out. Would it be possible to get a copy of the very first set of files in this thread, but with the password or unlocked? Than, you!
Retrieving data ...