API help needed
API help needed
Hi! I have to write a macro for my work and I can't get it to work, so if anyone could help me, I would be grateful.
For eg, an electrical drawing has multiple PMAs such as PMA17-100, PMA12-200, PMA17-500 etc. I need to write a macro that will firstly make a pop up box, msgbox, that will list the PMAs for eg: 2 PMA17: 100,500 , 1 PMA12-200. Also, I need it to then make a table in a drawing (next to where there is part name etc.) and in the first column it willl list PMA17 and PMA12 and then in the second column it would sum the numbers after - if the numbers after PMA are the same (for eg PMA17: 600, PMA12: 200). I am stuck on this for days, I can't even find the macro that does something similar so any help is reallllly needed
For eg, an electrical drawing has multiple PMAs such as PMA17-100, PMA12-200, PMA17-500 etc. I need to write a macro that will firstly make a pop up box, msgbox, that will list the PMAs for eg: 2 PMA17: 100,500 , 1 PMA12-200. Also, I need it to then make a table in a drawing (next to where there is part name etc.) and in the first column it willl list PMA17 and PMA12 and then in the second column it would sum the numbers after - if the numbers after PMA are the same (for eg PMA17: 600, PMA12: 200). I am stuck on this for days, I can't even find the macro that does something similar so any help is reallllly needed
Re: API help needed
Is this for SolidWorks Electrical?
Re: API help needed
yes, it is
Re: API help needed
SW electrical is really a different program that doesn't have much to do with SW... I know a number of sources for SW API support, but not for SW Electrical. There is a subforum on here for SWE but it doesn't look super busy. Sorry!
Re: API help needed
Hi, it is an electrical drawing but the PMAs I'm talking about, they are all notes on a drawing, so it is just an annotation. I can't find any similar API that will scan through notes on a drawing and do the things I described.
Re: API help needed
I think I misunderstood, it is an electrical drawing, but a normal Solidworks is used.
Re: API help needed
SWE runs inside SW only when you do the drawings. Share some files and pictures to explain what you are trying to accomplish.
Deepak Gupta
SOLIDWORKS Consultant/Blogger
SOLIDWORKS Consultant/Blogger
Re: API help needed
This would be an example. The three notes consisting of PMA is what I already have on a drawing. What I'm trying to do is to accomplish this table (the first column in this example are PMA17 and PMA12 since they are the only notes with prefix "PMA" on a drawing) and the second column is a number after - and if the number is same after PMA then the numbers after - should sum. Since there is PMA17-100 and PMA17-200 then 100+200=300.
And this is an example so the number of rows is unknown since there are always different PMAs on different drawings. But notes consisting of PMA is always in a form of PMAxx-xxx (x is a number). I don't know if this is possible to accomplish :/
And this is an example so the number of rows is unknown since there are always different PMAs on different drawings. But notes consisting of PMA is always in a form of PMAxx-xxx (x is a number). I don't know if this is possible to accomplish :/
Re: API help needed
One function of the macro I posted at https://www.cadforum.net/viewtopic.php?t=2672 is getting all notes on all sheets of a drawing. Some of that might be helpful to you.