Is there a way to automatically fill the custom properties with the file name so it looks something like. Solid modeling systems are design with an api application programming interface which form the canvas. Splitting bodies without losing designtree is there a way to split a part into a couple of bodies without losing the designtree in each split part. If you are using select methods only for getting your component2 object, i recommend calling getcomponentbyname or getcomponents from assemblydoc object selecting features always slows down your macros. Selectbyid2sketch2, sketch, 0, 0, 0, false, 1, nothing, 0. But when you are programming things you normally do not know the name or the click position of an entity. Using part of a file name in custom properties right now my files follow this naming scheme. While working on a presentation that a coworker created, i was reintroduced to the assembly feature join parts join is used when in an assembly mode. In the recorded makros the typical selection method is selectbyid2. This blog article assumes a little knowledge of programming and hardly scratches the surface of what is possible with solidworks macroapi functionality. In this article different selection methods and selection options will be discussed. That means if the selection target is not visible in the view like out of the view boundary or overlapped by another entity selection may fail. Solidworks will calculate the length of the belt depending on the positions of the pulleys, chain or sprocket. Solidworks api and pdm api training and services runcommand.
Selecting an edge of a part in a solidworks drawing. If you specify a positive, non0 mark for an object e. Select2false, 1 class component2 also has select method. Jun 08, 2011 simplify your life with simple macros posted on june 8, 2011 by royce cole quite often when the word automation comes up in cad discussions, we think of elaborate equations and programs that allow a user to enter in a few values and a factory is generated. One comment on selecting an edge of a part in a solidworks drawing october 3, 2016 at 7. Ich muss kontruktionstools entwickeln, um apparatebauspezifische baugruppen nach norm zu erzeugen. If you need a selected objects pointer then you just use iselectionmanagergetselectedobject6. If you are using select methods only for getting your component2 object, i recommend calling getcomponentbyname or getcomponents from assemblydoc object. Is availbale solidworks macro for open, rebuid, zoom to fit. Mark of 4 when selecting multiple edges or sketch segments and grouping them into one object for the path for a sweep feature. If you are going to program anything in solidworks, go the solidworks website and download the api documentation. One of the benefits of adding sketch entities directly to the database is that you can avoid grid and entity snapping. To verify that you must marshal an input object parameter to a variant, examine the methods vba syntax by clicking the link located in the visual basic 6 syntax section in the methods topic.
Selectbyid2, i want to select a face of this subpart, in the context of the assembly. Solidworks welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Fangen aktivieren, makro ds solidworkssolidworks foren. This example assumes that a static study has been initialized. Aug 07, 2012 i see this one in the api forums occasionally. Searching the api helps show that there is a property in the simulation api called shellthickness. The documentation team cannot answer technical support questions. Is availbale solidworks macro for open, rebuid, zoom to.
Api examples that not only show of to use various functions of the api application programming interface but also provide useful macros for everyday use. Manual api 2006 application programming interface variable. Advanced product development by luke malpass second in a series of highly popular books focusing intensively on the solidworks api programming toolset. Api help english only 2017 sp05 to disable web help from within solidworks and use local help instead, click help use solidworks web help. Im trying to create a macro that will insert drawing views from a model.
Two or more parts can be joined to create a new part. Different companies have standards, procedures and needs. Click here for information about technical support. Selectbyid2 name, type, x, y, z, append, mark, callout, selectoption. Search through the api all you want and you will never find an api call that shows or hides the featuremanager tree. Each year has an api help file for regular solidworks and edrawings. Extrude feature requires selection of the sketch and optional selection of direction mating. Api download it is worth mentioning that the api is free and comes with solidworks but the documentation does not install with solidworks. Solidworks api series advanced development ebook b00hssru3c. There are 2 sections in the summary information box. The first is the custom tab and the other is the configuration specific tab. For example, if you create a sketch line whose endpoint is near another entity or near a grid point, the new line endpoint snaps to the other item or grid point.
Hack a simulationusing the solidworks api engineers rule. Working backwards, the study object is retrieved by calling getstudy on the studymngr object. My drawing template already has views set up on 8 sheets so i just need a. Selectbyid2right plane, plane, 0, 0, 0, false, 0, null, 0. Use the form below to send your comments and suggestions about this topic directly to our documentation team. I only know the name of the face for instance e115 i tried something like the following but this does not work.
I have drawn a part up and now want to split into two to do further development. Jan 20, 2016 so if you are trying to select an edge, point or arc and nothing is highlighted, check your filter f5 first. Imodeldocextension selectbyray is recorded when imodeldocextension selectbyid2 relies on the selection coordinates and prone to failure if the model view is altered. To report problems encountered with the web help interface and search, contact your local support representative. Sldworks this will be called in all macros to get the solidworks object. Selection is a vital part of solidworks api development process. Hi there, i am quite new in api for solidworks, therefore i started with recording makros instead of writing it directly. Within solidworks, you can click the little tab with three arrows on it, and this will hide or show the featuremanager tree. Feature loschen per solidworksapi ds solidworkssolidworks. Simplify your life with simple macros dasi solutions blog. This macro will pass the values from the configuration specific window to the custom window then delete the configuration specific values. Api programmatically select a face and create a sketch. Cwobject and cosmosworks represent the root level objects for the solidworks simulation api interface, allowing further access to all of the functions of the simulation api.
The other cool part about this feature is, you have the option to automatically create a new part containing the belt sketch. Some solidworks methods have input object parameters that must be marshaled to variants because system. With the increase in the use of solidworks user interface in cad design. Furthermore selectbyid2 is a view specific method for some elements. Dim instance as imodeldocextension dim name as system. This set of lines gets the reference to the actual study we want to work with. Protetech blog for custom gui solidworks user interface. Firstly this book is written with the presumption that the reader has adequate knowledge of solidworks api programming either from experience or from reading my. Bstr name name of object to select or an empty string bstr type type of object uppercase or an empty string swselnothing swsledgesseledges edge. Mar, 2012 fundamental to writing macros and addins with the solidworks api is knowing how to get the pointer to a particular object.
133 405 1574 65 844 897 515 1150 106 846 1476 23 1413 1178 1329 15 421 451 650 609 216 766 1645 700 815 1475 290 9 930 872 417 492 118 483 557 643 642