There are a lot of different ways you can do this, yes! Simulation results can be exported as a deformed body or used as a guide to create new geometry. A lot depends on what your specific end goal is, good luck!
We have pdm pro & SW manage, & right now we're saving as a pdf. This is causing some issues with missing or light lines, text issues etc. I think the print as pdf might be more reliable, & was wondering how reliable etc., trying something like this would be for our process to print the pdfs etc.?
If you are having issues with the PDF creation process please reach out to your support provider to see if this is a known issue and to check the disposition of the issue. If you are an MLC CAD Systems customer you can reach us any time at www.mlc-cad.com/technical-support/
I see the same thing, the additional options are no longer available in that dialog. The macro recorder and API options have changed over the years. This tutorial applies to an older version but the approach to developing macros remains valid.
Check out the documentation for full details: help.solidworks.com/2021/English/api/sldworksapiprogguide/GettingStarted/SolidWorks_API_Standalone_and_Add-in_Applications_Overview.htm?id=3130735e77be414bb4076fef69172748#Pg0
Hi, My question is that I want to change the "open" command in the swp file using python. (This is because I have 10 folders with the equations.txt file that should update the cad using this macro). But cannot access swp file with python. Can you suggest a way, how can I change the path address of the sldpart inside swp file using python. I tried using bas, but that does not works as a macro, it only becomes a text file.
Since these macros are the same type of programs as Microsoft Office macros, you can search for ways to accomplish this in an Office program and it should apply here equally. I don't have anything specific to help you with this particular question though, good luck!
I watched all of your videos. I found a bug with the APIs. I have a list of X Y coordinates on excel. These are in millimeters. I read the coordinates then draw on SW. All circle of 1mm radius. In a for loop making a number of circles. Not all circles are in the correct place some rounded to the nearest mm and the radius is either bigger or smaller than 1mm. I use CreateCircleByRadius and or CreateCircleByRadius2 function calls. I don’t think the API can handle mm or less. I tried with 0.5 mm radius too. Any thoughts. For example 2.85mm sometimes gets rounded to 3mm but there are other measurements that do the same. I found a workaround. It only happens when viewing the plane as you sketch. I zoomed in x1000 and no issues.
Sounds like it might be a rounding issue with the display of dimensions or measurements. Modify the document properties or use the Measure tool and increase the decimal places to see the full dimension. Default behavior for metric templates using mm units is to hide decimals.
@@MLCCADSystems actually with trial and error I found the problem. If I watch the script drawing on screen then the problem occurs. But if I zoom in say 1000 times such that I cannot see what's being drawn on the screen, then the script create mathematically precise drawings as I wanted. I think it's a rendering issue with the software. I have a current Dell 7760 with 64GB ram and Nvidia RTX 4000 plus high end processor so the hardware is not the cause of the lag or innacuracy of any kind. Anyway thanks to you again I can make a spreadsheet that has 1000 calculated coordinates with formulas and don't have to draw them manually. 😊
@MLC CAD Systems @@FreePizza007 Hey this did not solve my problem. I have to draw 1000 circles in random points i have all the coordinates but Solidworks does not create this on vba for me. Just as an example i am attaching 3 coordinates Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1737556, 0.1051226, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1623084, 0.2016476, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.274112, 0.0244768, 0, 0.005) all the radius is different what is going on why is VBA not reliable? I cant seem to find any documentation on this anywhere. Can anyone please help me out, on how to fix this problem?
@@MLCCADSystems Can you please tell me why when i run this command the diameters are not picked as 0.005mm. I have changed the document properties and tried running my VBA in all units namely (m, mm, microns) none of them give me reliable results. The vba picks its own diameter why is this vba system not reliable. Please let me know. I need to create 1000 circles its hard to do it manually. I really need the help of a reliable VBA. Please let me know how to fix this problem. Sample - document unit mm (example 1- xCenter=0.1737556mm,yCenter=0.1051226mm, radius=0.005mm) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1737556, 0.1051226, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1623084, 0.2016476, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.274112, 0.0244768, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.3886547, 0.3759882, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(-0.0043453, 0.3759882, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.0462704, 0.1150589, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.3599373, 0.3554574, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.2663672, 0.2205662, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.2018715, 0.2883298, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.0469844, 0.2325053, 0, 0.005) Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1497608, 0.2290992, 0, 0.005)
@@ShyamPrasadVAtri We are unable to provide API support through the TH-cam comments section, but if you are a customer of MLC CAD Systems you can reach out to our support team on our website. The API has proven accurate in the past, I'm not sure what kind of issue you may be experiencing.
This would be a good time to reach out to your local Value-Added Reseller to assist with the issue. If you are an MLC CAD Systems customer, you can reach out here: www.mlc-cad.com/technical-support/
Generally speaking, if you can do it with a mouse and a keyboard, you can do it with a macro. Hopefully this video gets you started, and if you need additional resources check out Keith's site at www.cadsharp.com/
I think my favorite thing about the API is that you aren't limited by anything, which is great when you are doing something that is different than everyone else, but you want to customize the software to fit your needs.
We're not sharing the finished project for this tutorial, the goal is to learn the approach to creating a macro rather than to share code. There are many finished example projects in the help documentation and on resources such as 3DContentCentral.com
From the macro toolbar you can click the edit button or Tools > Macro > Edit, and open your recorded macro. If you want to skip the recorded macro section you can open it with Alt + F11
Congratulations!!!!!!!!!!!! 💥
hello! can we use solid works to perform parametric modelling(Using NURBS) based on our simulation results? Thanks.
There are a lot of different ways you can do this, yes! Simulation results can be exported as a deformed body or used as a guide to create new geometry. A lot depends on what your specific end goal is, good luck!
We have pdm pro & SW manage, & right now we're saving as a pdf. This is causing some issues with missing or light lines, text issues etc. I think the print as pdf might be more reliable, & was wondering how reliable etc., trying something like this would be for our process to print the pdfs etc.?
If you are having issues with the PDF creation process please reach out to your support provider to see if this is a known issue and to check the disposition of the issue. If you are an MLC CAD Systems customer you can reach us any time at www.mlc-cad.com/technical-support/
In the save as dialog, i just have only .swp type. How can I get others type. Could you help me with this problem?
I see the same thing, the additional options are no longer available in that dialog. The macro recorder and API options have changed over the years. This tutorial applies to an older version but the approach to developing macros remains valid.
Hey.. Keith is it possible to record solidwoeks api in c#
Check out the documentation for full details: help.solidworks.com/2021/English/api/sldworksapiprogguide/GettingStarted/SolidWorks_API_Standalone_and_Add-in_Applications_Overview.htm?id=3130735e77be414bb4076fef69172748#Pg0
Hi,
My question is that I want to change the "open" command in the swp file using python. (This is because I have 10 folders with the equations.txt file that should update the cad using this macro). But cannot access swp file with python.
Can you suggest a way, how can I change the path address of the sldpart inside swp file using python.
I tried using bas, but that does not works as a macro, it only becomes a text file.
Since these macros are the same type of programs as Microsoft Office macros, you can search for ways to accomplish this in an Office program and it should apply here equally. I don't have anything specific to help you with this particular question though, good luck!
I watched all of your videos. I found a bug with the APIs. I have a list of X Y coordinates on excel. These are in millimeters. I read the coordinates then draw on SW. All circle of 1mm radius. In a for loop making a number of circles. Not all circles are in the correct place some rounded to the nearest mm and the radius is either bigger or smaller than 1mm.
I use CreateCircleByRadius and or CreateCircleByRadius2 function calls.
I don’t think the API can handle mm or less. I tried with 0.5 mm radius too. Any thoughts.
For example 2.85mm sometimes gets rounded to 3mm but there are other measurements that do the same.
I found a workaround. It only happens when viewing the plane as you sketch. I zoomed in x1000 and no issues.
Sounds like it might be a rounding issue with the display of dimensions or measurements. Modify the document properties or use the Measure tool and increase the decimal places to see the full dimension. Default behavior for metric templates using mm units is to hide decimals.
@@MLCCADSystems actually with trial and error I found the problem. If I watch the script drawing on screen then the problem occurs. But if I zoom in say 1000 times such that I cannot see what's being drawn on the screen, then the script create mathematically precise drawings as I wanted. I think it's a rendering issue with the software. I have a current Dell 7760 with 64GB ram and Nvidia RTX 4000 plus high end processor so the hardware is not the cause of the lag or innacuracy of any kind.
Anyway thanks to you again I can make a spreadsheet that has 1000 calculated coordinates with formulas and don't have to draw them manually. 😊
@MLC CAD Systems @@FreePizza007 Hey this did not solve my problem. I have to draw 1000 circles in random points i have all the coordinates but Solidworks does not create this on vba for me.
Just as an example i am attaching 3 coordinates
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1737556, 0.1051226, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1623084, 0.2016476, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.274112, 0.0244768, 0, 0.005)
all the radius is different what is going on why is VBA not reliable?
I cant seem to find any documentation on this anywhere. Can anyone please help me out, on how to fix this problem?
@@MLCCADSystems Can you please tell me why when i run this command the diameters are not picked as 0.005mm. I have changed the document properties and tried running my VBA in all units namely (m, mm, microns) none of them give me reliable results. The vba picks its own diameter why is this vba system not reliable. Please let me know. I need to create 1000 circles its hard to do it manually. I really need the help of a reliable VBA. Please let me know how to fix this problem.
Sample - document unit mm (example 1- xCenter=0.1737556mm,yCenter=0.1051226mm, radius=0.005mm)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1737556, 0.1051226, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1623084, 0.2016476, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.274112, 0.0244768, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.3886547, 0.3759882, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(-0.0043453, 0.3759882, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.0462704, 0.1150589, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.3599373, 0.3554574, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.2663672, 0.2205662, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.2018715, 0.2883298, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.0469844, 0.2325053, 0, 0.005)
Set mySketchSegment = swSketchManager.CreateCircleByRadius(0.1497608, 0.2290992, 0, 0.005)
@@ShyamPrasadVAtri We are unable to provide API support through the TH-cam comments section, but if you are a customer of MLC CAD Systems you can reach out to our support team on our website. The API has proven accurate in the past, I'm not sure what kind of issue you may be experiencing.
Hi Keith, would you accept any online training?
This was a guest spot Keith did for us, you can reach out to Keith directly at his company: www.cadsharp.com/.
how can i download the part
You can use any part, the dimension names are captured during the tutorial so it doesn't need to be the same one.
Perfect content
Thank you!
I use SolidWorks 2019. But the support file for the tutorial is not opening. (Future version). Can I get download link compatible with 2019
You can use any file, it doesn't need to be this specific one. The video shows how to collect the information needed to connect to your file.
Solidworks was not found in your machine?pls help
This would be a good time to reach out to your local Value-Added Reseller to assist with the issue. If you are an MLC CAD Systems customer, you can reach out here: www.mlc-cad.com/technical-support/
Hi, Keith can we create sheet metal flat pattern using macro?
Generally speaking, if you can do it with a mouse and a keyboard, you can do it with a macro. Hopefully this video gets you started, and if you need additional resources check out Keith's site at www.cadsharp.com/
This was a really well explained video. Where do we find the Solidworks Part model that you work on in the upcoming videos.
Any part can be used for this example, you simply need to capture a dimension name to drive.
5:00
12:00
What’s your favorite application of being able to access Solidworks API?
I think my favorite thing about the API is that you aren't limited by anything, which is great when you are doing something that is different than everyone else, but you want to customize the software to fit your needs.
This is fantastic! Could you please share codes used in the videos of this playlist?
We're not sharing the finished project for this tutorial, the goal is to learn the approach to creating a macro rather than to share code. There are many finished example projects in the help documentation and on resources such as 3DContentCentral.com
Doesn't make sense. It's like printing a book with missing pages.
@@MLCCADSystems is this website address correct? doesn't open.
Excellent teaching best video I had on solidworks API
SOLIDWORKS API for the Total Beginner, first movie and it's not shown how to open VBE... not helpful
From the macro toolbar you can click the edit button or Tools > Macro > Edit, and open your recorded macro. If you want to skip the recorded macro section you can open it with Alt + F11
interesting
Rcrd stps as codes