{"id":20035,"date":"2020-02-11T05:30:56","date_gmt":"2020-02-11T05:30:56","guid":{"rendered":"https:\/\/ckonnect.in\/solidworks\/?p=20035"},"modified":"2022-04-23T11:55:29","modified_gmt":"2022-04-23T06:25:29","slug":"macros-for-solidworks","status":"publish","type":"post","link":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/","title":{"rendered":"BASIC MACRO In SOLIDWORKS"},"content":{"rendered":"<p>From the menus and toolbars that we are familiar with every day in <a href=\"https:\/\/ckonnect.in\/solidworks\/solidworks-3d-cad\/\">SOLIDWORKS<\/a>, it is actually able to meet the work well.\u00a0But if wanting to increase the efficiency of your work even more than before, one option is to create different templates for regular use over and over.\u00a0And another option is to create specialized programs for your own use.<\/p>\n<h2>SOLIDWORKS Macros Creation<\/h2>\n<p>Allowing us to perform specific tasks that we need to be easier and faster. Just by clicking the <strong>&#8220;Run&#8221; command in SOLDWORKS<\/strong>, we are able to create programs to use by ourselves.\u00a0Which is fundamentally the simplest, we call it Macro creation.<\/p>\n<p>Macro. If anyone has experienced it, we can find it in many places, whether it&#8217;s Microsoft Excel\u00a0When we want to automate certain operations, we create that macro and use VBA (Visual Basic for Application) to help view the code of that macro. In SOLIDWORKS there are concepts such as The same thing is, we create a macro for a process and then use the VBA to open the code and make some changes in the direction we want.\u00a0Actually, not only VBA can be used in SOLIDWORKS, but there are also C # and VB.net to choose according to each individual&#8217;s aptitude.<\/p>\n<h3>SOLIDWORKS Macros Recording<\/h3>\n<p>Macro can be done easily by recording the macro. As in this picture, I will create a hole on a solid square piece. In which the hole will be a circle Diameter 10 mm and depth 20 mm, where the distance from the edge is 25 and 30 mm, as shown<\/p>\n<h3>Basic Macros in SOLIDWORKS Record &amp; Play<\/h3>\n<p>And before I started to build\u00a0Which means including starting from the click on the surface to define the plane of the sketch and drill holes into that work\u00a0I will record the macro first.\u00a0Which is done during the recording of the macro will be kept in all formats\u00a0This macro recording can be done by going to Tools&gt; Macro&gt; Record and then starting the hole drilling process.<br \/>\nIn the hole drilling process, it will start by selecting the plane surface.\u00a0Click to create a sketch, draw a circle, set the distance of 25 mm and 30 mm, specify the line size through the center of the circle 20 mm. Click out of the sketch, extrude-cut, set the distance equal to 25 mm and click the last check mark.\u00a0Then it will stop recording that macro and save that macro to where we want it\u00a0Which the surname will be * .SW VBA Macro (SWP)<br \/>\nAnd the next step, we will look inside the macros that we have saved, how they look inside by going to <strong>Tools&gt; Macro&gt; Edit and selecting the macros<\/strong> that we have saved\u00a0Its face is what it shows.<\/p>\n<p>Take a good look at the code, it seems difficult, but not too difficult with the language of VB that is easy to understand.\u00a0Which will start from top to bottom respectively\u00a0Start by creating sketches\u00a0(InsertSketch) Then I created a circle, set the distance 25 (myDimension.SystemValue = 0.025) and set the interval 30 (myDimension.SystemValue = 0.03) set the circle size 20 mm (myDimension.SystemValue = 0.02) and set the depth of drill 25 Mm (FeatureCut4 = 0.025) as shown in the code<\/p>\n<p>I returned to the model that I had specified. I removed the extrude cut feature that was already specified. Then I go to <strong>Tool&gt; Macro&gt; Run and select the saved macros.<\/strong> Then I can see that I can create a hole without having to write a sketch and make a new ExtrudeCut.<\/p>\n<p>Run from the code that has been created.\u00a0And we are able to create and apply to many<br \/>\n<img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-18076 size-full\" src=\"https:\/\/ckonnect.in\/solidworks\/wp-content\/uploads\/2020\/02\/con1.jpg\" alt=\"Macros for SOLIDWORKS\" width=\"568\" height=\"435\" data-id=\"18076\" \/><br \/>\nprojects, which will greatly reduce our work time.\u00a0If you want to change the size of the hole, the distance can be done by editing the numbers in that macro straight away.\u00a0Which is very convenient to feature many different sizes and can be picked up immediately<br \/>\nHowever, this is just an example of how to start creating your own program in SOLIDWORKS.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From the menus and toolbars that we are familiar with every day in SOLIDWORKS, it is actually able to meet the work well.\u00a0But if wanting to increase the efficiency of your work even more than before, one option is to create different templates for regular use over and over.\u00a0And another option is to create specialized &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;BASIC MACRO In SOLIDWORKS&#8221;<\/span><\/a><\/p>\n","protected":false},"author":41,"featured_media":20096,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[184],"tags":[],"class_list":["post-20035","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-3d-cad","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Basic Macros for SOLIDWORKS - Record &amp; Play Macro<\/title>\n<meta name=\"description\" content=\"By clicking the &quot;Run&quot; command in SOLDWORKS, we are able to create programs to use by ourselves. We call it Macros for SOLIDWORKS creation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Basic Macros for SOLIDWORKS - Record &amp; Play Macro\" \/>\n<meta property=\"og:description\" content=\"By clicking the &quot;Run&quot; command in SOLDWORKS, we are able to create programs to use by ourselves. We call it Macros for SOLIDWORKS creation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/\" \/>\n<meta property=\"og:site_name\" content=\"Conceptia\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-11T05:30:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-23T06:25:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ckonnect.in\/solidworks\/wp-content\/uploads\/2020\/02\/blog.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"715\" \/>\n\t<meta property=\"og:image:height\" content=\"446\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sanjay mandia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sanjay mandia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Basic Macros for SOLIDWORKS - Record & Play Macro","description":"By clicking the \"Run\" command in SOLDWORKS, we are able to create programs to use by ourselves. We call it Macros for SOLIDWORKS creation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/","og_locale":"en_US","og_type":"article","og_title":"Basic Macros for SOLIDWORKS - Record & Play Macro","og_description":"By clicking the \"Run\" command in SOLDWORKS, we are able to create programs to use by ourselves. We call it Macros for SOLIDWORKS creation.","og_url":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/","og_site_name":"Conceptia","article_published_time":"2020-02-11T05:30:56+00:00","article_modified_time":"2022-04-23T06:25:29+00:00","og_image":[{"width":715,"height":446,"url":"https:\/\/ckonnect.in\/solidworks\/wp-content\/uploads\/2020\/02\/blog.jpg","type":"image\/jpeg"}],"author":"Sanjay mandia","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sanjay mandia","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/#article","isPartOf":{"@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/"},"author":{"name":"Sanjay mandia","@id":"https:\/\/ckonnect.in\/solidworks\/#\/schema\/person\/555f0a5d950d3c397fe3c5ec9779b706"},"headline":"BASIC MACRO In SOLIDWORKS","datePublished":"2020-02-11T05:30:56+00:00","dateModified":"2022-04-23T06:25:29+00:00","mainEntityOfPage":{"@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/"},"wordCount":674,"commentCount":0,"publisher":{"@id":"https:\/\/ckonnect.in\/solidworks\/#organization"},"image":{"@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/#primaryimage"},"thumbnailUrl":"https:\/\/ckonnect.in\/solidworks\/wp-content\/uploads\/2020\/02\/blog.jpg","articleSection":["3D CAD"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/","url":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/","name":"Basic Macros for SOLIDWORKS - Record & Play Macro","isPartOf":{"@id":"https:\/\/ckonnect.in\/solidworks\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/#primaryimage"},"image":{"@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/#primaryimage"},"thumbnailUrl":"https:\/\/ckonnect.in\/solidworks\/wp-content\/uploads\/2020\/02\/blog.jpg","datePublished":"2020-02-11T05:30:56+00:00","dateModified":"2022-04-23T06:25:29+00:00","description":"By clicking the \"Run\" command in SOLDWORKS, we are able to create programs to use by ourselves. We call it Macros for SOLIDWORKS creation.","breadcrumb":{"@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/#primaryimage","url":"https:\/\/ckonnect.in\/solidworks\/wp-content\/uploads\/2020\/02\/blog.jpg","contentUrl":"https:\/\/ckonnect.in\/solidworks\/wp-content\/uploads\/2020\/02\/blog.jpg","width":715,"height":446},{"@type":"BreadcrumbList","@id":"https:\/\/ckonnect.in\/solidworks\/macros-for-solidworks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ckonnect.in\/solidworks\/"},{"@type":"ListItem","position":2,"name":"BASIC MACRO In SOLIDWORKS"}]},{"@type":"WebSite","@id":"https:\/\/ckonnect.in\/solidworks\/#website","url":"https:\/\/ckonnect.in\/solidworks\/","name":"Conceptia","description":"","publisher":{"@id":"https:\/\/ckonnect.in\/solidworks\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ckonnect.in\/solidworks\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ckonnect.in\/solidworks\/#organization","name":"Conceptia","url":"https:\/\/ckonnect.in\/solidworks\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ckonnect.in\/solidworks\/#\/schema\/logo\/image\/","url":"https:\/\/ckonnect.in\/solidworks\/wp-content\/uploads\/2021\/09\/cropped-Conceptia-White-background.png","contentUrl":"https:\/\/ckonnect.in\/solidworks\/wp-content\/uploads\/2021\/09\/cropped-Conceptia-White-background.png","width":496,"height":46,"caption":"Conceptia"},"image":{"@id":"https:\/\/ckonnect.in\/solidworks\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/ckonnect.in\/solidworks\/#\/schema\/person\/555f0a5d950d3c397fe3c5ec9779b706","name":"Sanjay mandia","url":"https:\/\/ckonnect.in\/solidworks\/author\/sanjay-mandia\/"}]}},"_links":{"self":[{"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/posts\/20035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/comments?post=20035"}],"version-history":[{"count":1,"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/posts\/20035\/revisions"}],"predecessor-version":[{"id":33684,"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/posts\/20035\/revisions\/33684"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/media\/20096"}],"wp:attachment":[{"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/media?parent=20035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/categories?post=20035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ckonnect.in\/solidworks\/wp-json\/wp\/v2\/tags?post=20035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}