SOLIDWORKS API for the Total Beginner - 1/6 Introduction & Macro Recorder

Поділитися
Вставка
  • Опубліковано 4 лют 2021
  • SOLIDWORKS API for the Total Beginner
    This video features guest contributor Keith Rice from CADSharp.com. This 6-part video tutorial series takes users from the most basic Macro Recorder that anyone can use to record clicks and actions, through building a custom macro from scratch. He introduces three pillars or skills that are required to create and operate these macros at a high level: Programming using VBA, Using API Help, Understanding the SOLIDWORKS API Object Model. If you need help with an API project for your SOLIDWORKS or PDM environment, contact MLC CAD Systems today to see what options are best for you.
    Full Playlist: • API Tutorials
    1. Introduction & Macro Recorder - • SOLIDWORKS API for the...
    2. Writing Code in VBA - • SOLIDWORKS API for the...
    3. Using Calls and Interfaces - • SOLIDWORKS API for the...
    4. Putting your Macro to Action - • SOLIDWORKS API for the...
    5. Creating a Drawing - • SOLIDWORKS API for the...
    6. Saving out Files - • SOLIDWORKS API for the...
    ‪@solidworks‬ #API #Automation #Tutorial
  • Наука та технологія

КОМЕНТАРІ • 37

  • @atulwithsmile
    @atulwithsmile 3 роки тому +1

    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.

    • @MLCCADSystems
      @MLCCADSystems  3 роки тому

      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!

  • @desenhotecnico-engineering1485

    Congratulations!!!!!!!!!!!! 💥

  • @robd2650
    @robd2650 2 роки тому +1

    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.?

    • @MLCCADSystems
      @MLCCADSystems  2 роки тому

      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/

  • @femiadegoke8091
    @femiadegoke8091 2 роки тому

    I use SolidWorks 2019. But the support file for the tutorial is not opening. (Future version). Can I get download link compatible with 2019

    • @MLCCADSystems
      @MLCCADSystems  2 роки тому

      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.

  • @vigneshviggy-e4l
    @vigneshviggy-e4l 13 днів тому +1

    hello! can we use solid works to perform parametric modelling(Using NURBS) based on our simulation results? Thanks.

    • @MLCCADSystems
      @MLCCADSystems  13 днів тому

      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!

  • @dhrubosaha210
    @dhrubosaha210 Рік тому

    This was a really well explained video. Where do we find the Solidworks Part model that you work on in the upcoming videos.

    • @MLCCADSystems
      @MLCCADSystems  Рік тому

      Any part can be used for this example, you simply need to capture a dimension name to drive.

  • @FreePizza007
    @FreePizza007 2 роки тому +1

    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.

    • @MLCCADSystems
      @MLCCADSystems  2 роки тому

      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.

    • @FreePizza007
      @FreePizza007 Рік тому +1

      @@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. 😊

    • @ShyamPrasadVAtri
      @ShyamPrasadVAtri Рік тому

      ​ @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?

    • @ShyamPrasadVAtri
      @ShyamPrasadVAtri Рік тому

      @@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)

    • @MLCCADSystems
      @MLCCADSystems  Рік тому

      @@ShyamPrasadVAtri We are unable to provide API support through the UA-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.

  • @phekusharma5584
    @phekusharma5584 2 роки тому

    Hi, Keith can we create sheet metal flat pattern using macro?

    • @MLCCADSystems
      @MLCCADSystems  2 роки тому +2

      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/

  • @khanhpham-do3vd
    @khanhpham-do3vd 7 місяців тому

    In the save as dialog, i just have only .swp type. How can I get others type. Could you help me with this problem?

    • @MLCCADSystems
      @MLCCADSystems  7 місяців тому

      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.

  • @thirunavukkarasuthangavel7055
    @thirunavukkarasuthangavel7055 2 роки тому +1

    Hey.. Keith is it possible to record solidwoeks api in c#

    • @MLCCADSystems
      @MLCCADSystems  2 роки тому

      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

  • @michaelesperanza1204
    @michaelesperanza1204 2 роки тому

    Solidworks was not found in your machine?pls help

    • @MLCCADSystems
      @MLCCADSystems  2 роки тому

      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/

  • @aalba91
    @aalba91 2 роки тому +1

    how can i download the part

    • @MLCCADSystems
      @MLCCADSystems  2 роки тому

      You can use any part, the dimension names are captured during the tutorial so it doesn't need to be the same one.

  • @alishamseddin1592
    @alishamseddin1592 2 роки тому +1

    Hi Keith, would you accept any online training?

    • @MLCCADSystems
      @MLCCADSystems  2 роки тому

      This was a guest spot Keith did for us, you can reach out to Keith directly at his company: www.cadsharp.com/.

  • @raymondzhao9557
    @raymondzhao9557 2 роки тому +1

    interesting

  • @abghrnjd
    @abghrnjd 3 роки тому

    This is fantastic! Could you please share codes used in the videos of this playlist?

    • @MLCCADSystems
      @MLCCADSystems  3 роки тому +3

      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

    • @abghrnjd
      @abghrnjd 3 роки тому +2

      Doesn't make sense. It's like printing a book with missing pages.

    • @abghrnjd
      @abghrnjd 3 роки тому +1

      @@MLCCADSystems is this website address correct? doesn't open.

    • @Cricketworld_kohli
      @Cricketworld_kohli 7 місяців тому

      Excellent teaching best video I had on solidworks API

  • @maciejwojda2774
    @maciejwojda2774 2 роки тому

    SOLIDWORKS API for the Total Beginner, first movie and it's not shown how to open VBE... not helpful

    • @MLCCADSystems
      @MLCCADSystems  2 роки тому

      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