Search found 44 matches
- Wed Oct 02, 2024 5:41 am
- Forum: API
- Topic: DXF tester for CNC cutting. Direct interaction with DXF without libraries (VBA)
- Replies: 0
- Views: 381
DXF tester for CNC cutting. Direct interaction with DXF without libraries (VBA)
The task was to make a simple tester of DXF files after Solidworks for laser cutting. It is necessary to check obvious errors: Intersection of contours, overlapping of contours, free end of contour (openness). The macro was not originally intended as a separate one, it was intended as a set of modul...
- Wed Oct 02, 2024 2:16 am
- Forum: API
- Topic: Google Drive and SWP files
- Replies: 1
- Views: 495
Re: Google Drive and SWP files
Yes, even if you manage to upload the SWP file to Google Drive. It will not sync later, this is due to the fact that it "happily" coincided that this extension is used for some Google service files. I don't remember exactly what it was about, but I found a thread with such a question on th...
- Thu Jun 27, 2024 5:12 am
- Forum: API
- Topic: How do I know that you are FLAT-PATTERN?
- Replies: 23
- Views: 7737
Re: How do I know that you are FLAT-PATTERN?
One more question about sheet metal and VBA API deployments. What is the best way to programmatically get the dependent configuration with the FLAT-PATTERN state of the sheet metal part. I have a method that works, but it is very crude, based on passing incorrect parameters to an old function that t...
- Mon Jun 10, 2024 11:23 am
- Forum: API
- Topic: Get Template Anchor Points
- Replies: 2
- Views: 851
Re: Get Template Anchor Points
TableAnchor Property (ISheet) (https://help.solidworks.com/2024/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISheet~TableAnchor.html) -> Position Property (ITableAnchor) (https://help.solidworks.com/2024/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWor...
- Sun Jun 09, 2024 4:16 am
- Forum: API
- Topic: Get Template Anchor Points
- Replies: 2
- Views: 851
Get Template Anchor Points
I want to insert a block into a drawing so that the block falls into one of the anchor points for the tables. For example, to the anchor point for "Holes table anchor1". How can I get these pre-arranged points on a drawing template? I thought about inserting the block itself using: MakeSke...
- Fri May 24, 2024 3:00 am
- Forum: SW General
- Topic: Direct connection CutList Property to the Custom Property
- Replies: 9
- Views: 2831
Re: Direct connection CutList Property to the Custom Property
We are talking around each other. Let's look at it a different way. If you could do what you are asking, how would you use it? In other words, why do you want to be able to do this? If only I could do it. Then for parts with one sheet body, or with one construct body, I would do: I made a direct li...
- Wed May 22, 2024 7:18 am
- Forum: SW General
- Topic: Direct connection CutList Property to the Custom Property
- Replies: 9
- Views: 2831
Re: Direct connection CutList Property to the Custom Property
The ambiguity is that there is no restriction on the number of bodies in a configuration. If I have a part file with one configuration and two bodies (and therefore two cut list items), and I give each body a different value for a the same user defined cut list property, just what do you expect to ...
- Wed May 22, 2024 2:56 am
- Forum: API
- Topic: Browse Folder
- Replies: 13
- Views: 7285
Re: Browse Folder
Other option might be to use excel API to show the browse folder window which will behave the way you need. Option to select a folder in a convenient window using the Excel API in Solidworks VBA. I'll leave this here. excelLib.jpg Dim xlApp As Excel.Application 'Dim xlWB As Excel.Workbook Dim Folde...
- Wed May 22, 2024 1:45 am
- Forum: SW General
- Topic: Direct connection CutList Property to the Custom Property
- Replies: 9
- Views: 2831
Re: Direct connection CutList Property to the Custom Property
Edit: Now that I think of it, there could be an expression added to the source code to say that If more then 2 bodies then do not transfer properties to the top level. This is exactly what I implement using the API. I need to decide what the Engineer does: - Makes a regular sheet metal part with on...
- Wed May 22, 2024 1:37 am
- Forum: SW General
- Topic: Direct connection CutList Property to the Custom Property
- Replies: 9
- Views: 2831
Re: Direct connection CutList Property to the Custom Property
What should SOLIDWORKS do when two cutlist items have the same user defined property? Which one gets to populate the file property? What you are asking for doesn't make sense. Apparently I don't understand something. Because it makes sense to me. In Solidworks there cannot be two bodies with the sa...
- Tue May 21, 2024 2:12 pm
- Forum: SW General
- Topic: Direct connection CutList Property to the Custom Property
- Replies: 9
- Views: 2831
Direct connection CutList Property to the Custom Property
I ask for a clear answer! As of May 2024, no version of the Solidworks software product can establish a direct relationship between a user property value from a cutlist and a user property? (without add-ons and without API) I have determined that only expressions starting with "SW-" can be...
- Tue Feb 06, 2024 8:23 am
- Forum: API
- Topic: WasResolved from Get6 (CustomPropertyManager)
- Replies: 4
- Views: 1515
Re: WasResolved from Get6 (CustomPropertyManager)
Stefan Sterk wrote: ↑Tue Jan 30, 2024 4:24 pm I also tried to imitated these conditions, and also got only TRUE values for WasResolved, since the value cleary wasn't as is shown in the attached image below. Using SOLIDWORKS 2023.
Well, what can I say: it was so, it is so, and it will be so forever and ever.
- Tue Jan 30, 2024 9:57 am
- Forum: API
- Topic: WasResolved from Get6 (CustomPropertyManager)
- Replies: 4
- Views: 1515
Re: WasResolved from Get6 (CustomPropertyManager)
The remarks section on the help page explain the scenarios where the resolved value can return false https://help.solidworks.com/2018/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.icustompropertymanager~get6.html I imitated these conditions and got WasResolved=True
- Fri Jan 26, 2024 4:32 am
- Forum: API
- Topic: WasResolved from Get6 (CustomPropertyManager)
- Replies: 4
- Views: 1515
WasResolved from Get6 (CustomPropertyManager)
How does Solidworks software decide which expression could be evaluated and which could not? We are talking about the function Get6(Get5) of reading user properties through the CustomPropertyManager interface value = instance.Get6(FieldName, UseCached, ValOut, ResolvedValOut, WasResolved, LinkToPro...
- Fri Dec 22, 2023 12:27 pm
- Forum: API
- Topic: How do I know that you are FLAT-PATTERN?
- Replies: 23
- Views: 7737
Re: How do I know that you are FLAT-PATTERN?
It's not worse. It could be more complexity than necessary for a lot of applications but if it works in your program the way it is then I'd leave it in there the way it is. I did some tests, maybe they are not complete, I could not do other situations except for very trivial ones (when the part is ...
- Sun Dec 17, 2023 2:38 am
- Forum: API
- Topic: how to get 3D coordinates of a sketch segment in the global coordinate system?
- Replies: 1
- Views: 1269
how to get 3D coordinates of a sketch segment in the global coordinate system?
Initial parameters: There is a test part file PRUG_test_dim_on_SM-FP . It has a sheet metal rectangle located in space not orthogonal to any of the sides - by accident. Why sheet metal? To have a Boundary_Box sketch. Why a rectangle? To make the Boundary_Box sketch coincide with the edge of the rect...
- Wed Dec 06, 2023 12:44 pm
- Forum: API
- Topic: Beautiful dimensions of width and height on Boundary Box Sketch in the drawing view of Flat-pattern
- Replies: 1
- Views: 1391
Beautiful dimensions of width and height on Boundary Box Sketch in the drawing view of Flat-pattern
Task: There is a part with sheet metal. For it, a drawing is created with one view of Flat-pattern. For this view, the Sketch of the Boundary Box is displayed. Next, we define 2 perpendicular elements among the elements of this sketch (or simply by the names Line1 and Line4, at least that way). and ...
- Wed Dec 06, 2023 11:20 am
- Forum: API
- Topic: How do I know that you are FLAT-PATTERN?
- Replies: 23
- Views: 7737
Re: How do I know that you are FLAT-PATTERN?
You mentioned that you were running a macro that looked at all parts in an assembly and exported the DXF flat pattern if it was sheet metal, so it doesn't sound unimportant to you. Others were also discussing methods for exporting the DXF flat pattern so I described my method that is independent of...
- Wed Dec 06, 2023 10:59 am
- Forum: API
- Topic: How do I know that you are FLAT-PATTERN?
- Replies: 23
- Views: 7737
Re: How do I know that you are FLAT-PATTERN?
I guess most of us assumed you are trying to save a dxf of the flat from the model. Is that not what you're trying to do? If you are trying to automate saving dxfs of flats, that has little (possibly nothing) to do with flat configurations. The automatically generated "[parentFormedCofigName]S...
- Sat Dec 02, 2023 3:18 pm
- Forum: API
- Topic: How do I know that you are FLAT-PATTERN?
- Replies: 23
- Views: 7737
Re: How do I know that you are FLAT-PATTERN?
The way I've done it before is the following with my formed or flat configuration open in SW: - I open a blank drawing template (no border, blocks, etc.) - I use IDrawingDoc::CreateFlatPatternViewFromModelView3() to add my flat pattern view to my drawing. Note that this adds it for the specified co...
- Sat Nov 04, 2023 11:33 am
- Forum: API
- Topic: ListExternalFileReferences and ReplaceReferencedDocument without Opening
- Replies: 1
- Views: 1047
ListExternalFileReferences and ReplaceReferencedDocument without Opening
Can I get external links of a part without opening it, as the Solidworks application does with: File-Open-Links. I want to replace a substring in the file name of a part that is referenced by the part being opened using the "swApp.ReplaceReferencedDocument" function. It allows you to chang...
- Fri Oct 13, 2023 8:46 am
- Forum: API
- Topic: How do I know that you are FLAT-PATTERN?
- Replies: 23
- Views: 7737
Re: How do I know that you are FLAT-PATTERN?
If you have the option "Automatically populate view pallet with views" checked, it will create the config for you when you start a drawing of the sheetmetal part. I know about this feature for happy users. When we create a drawing for a sheet metal part, a flat pattern sub-configuration i...
- Fri Oct 13, 2023 8:40 am
- Forum: API
- Topic: How do I know that you are FLAT-PATTERN?
- Replies: 23
- Views: 7737
Re: How do I know that you are FLAT-PATTERN?
What is it you are trying to do with the automatically generated "SM-FLAT-PATTERN" config? The gist is this: the user runs the macro directly from the Assembly. Next, all components of the parts are searched at all levels, and if the part is made of sheet metal, then the DXF flat pattern ...
- Thu Oct 12, 2023 5:58 am
- Forum: API
- Topic: How do I know that you are FLAT-PATTERN?
- Replies: 23
- Views: 7737
How do I know that you are FLAT-PATTERN?
SM-FLAT-PATTERN 02_Derived_Configuration.jpg How does the FLAT-PATTERN configuration work? Does it have any identifiers other than the keyword in the name "SM-FLAT-PATTERN"? How can I find out this configuration FLAT-PATTERN, other than a substring in the name? This substring (SM-FLAT-PAT...
- Wed Oct 11, 2023 2:37 pm
- Forum: API
- Topic: What is the image size for the macro button?
- Replies: 16
- Views: 4717
Re: What is the image size for the macro button?
It would be lovely if you would share some of your icons, they seem really well made and I'm sure a lot of people would be happy to use them and also find them "collected" in a single place such as a thread on a forum. Not all of my icons are 20x20 pixels, some are smaller. They are in th...
- Wed Oct 11, 2023 3:27 am
- Forum: API
- Topic: Multi Export Assembly and Parts with Structure
- Replies: 2
- Views: 1269
Re: Multi Export Assembly and Parts with Structure
Any Ideas on how to fix that other that rearranging the whole String? A similar Macro would help too if you have seen something like that already. Stefan Sterk option is the best. You'll have to track down duplicates now. There is an alternative option: you can get the component file name from the ...
- Wed Oct 11, 2023 3:14 am
- Forum: API
- Topic: What is the image size for the macro button?
- Replies: 16
- Views: 4717
Re: What is the image size for the macro button?
Hello Mikhov, can you describe how and with what software you create the icons? It so happens that I use Photoshop. This is too much for making icons - but it is convenient for me. Somewhere on the Internet I found a canvas with most of the Solidworks icons on a white background. And I just take th...
- Sat Sep 30, 2023 4:33 am
- Forum: SW General
- Topic: Flexible fastening element: rivet. How to do it right.
- Replies: 6
- Views: 1690
Re: Flexible fastening element: rivet. How to do it right.
So here is your enhancement request.. While there are no improvements, keep from me a life hack on how to place hex fasteners in hex holes. (To be honest, the fastener has a cylindrical concentric surface with a hexagon, but if it didn’t exist we would have created an auxiliary axis). 1. In the ass...
- Tue Sep 26, 2023 5:32 am
- Forum: SW General
- Topic: Flexible fastening element: rivet. How to do it right.
- Replies: 6
- Views: 1690
Re: Flexible fastening element: rivet. How to do it right.
The result and my conclusion on this problem. Is it possible to make the fastener flexible and insert it into the assembly - Yes. Is it convenient - No. What is the problem: Flexible fasteners, such as rivets and all other deformable fasteners, have working ranges. A "flexible" element is ...
- Fri Sep 22, 2023 9:28 am
- Forum: SW General
- Topic: Flexible fastening element: rivet. How to do it right.
- Replies: 6
- Views: 1690
Re: Flexible fastening element: rivet. How to do it right.
I don't have a problem with the BOM display and don't want to do it as a flexible subassembly. What I want is a flexible part. For the rivet, this is exactly what she needs. Now I have an option with multiple configurations for each thickness - but there is no beauty in this solution. ffd.jpg I made...
- Thu Sep 21, 2023 12:55 pm
- Forum: SW General
- Topic: Flexible fastening element: rivet. How to do it right.
- Replies: 6
- Views: 1690
Flexible fastening element: rivet. How to do it right.
I often use rivet nuts. Among them there are the most interesting ones, which have a whole bunch of atypical circumstances. I have 2 main questions: *Attention, we are not talking about adding a Toolbox here, all fasteners are made as parts, they are in a special folder and their IsToolBoxPart prope...
- Tue Sep 12, 2023 5:39 pm
- Forum: API
- Topic: Multiple export of ready-made DXF to JPG miniatures
- Replies: 1
- Views: 980
Re: Multiple export of ready-made DXF to JPG miniatures
For example, you can organize multiple selection of DXF files from a folder using the Excel library Dim swApp As SldWorks.SldWorks Sub main() Set swApp = Application.SldWorks Dim FileFromSelect As String ' Dim FilesCompNames() As String ' Tools-Reference... Microsoft Excel xx + Microsoft Office xx ...
- Tue Sep 12, 2023 5:09 pm
- Forum: API
- Topic: Multiple export of ready-made DXF to JPG miniatures
- Replies: 1
- Views: 980
Multiple export of ready-made DXF to JPG miniatures
The main part of the macro is the SaveJPGfromDXF function, which receives an array of full paths of DXF files and saves them back as JPG images ( with the specified parameters ). It is understood that the file paths could be obtained in different ways. For example, you can organize multiple selectio...
- Wed Sep 06, 2023 1:43 am
- Forum: API
- Topic: OpenDoc6 works correctly only in debug mode
- Replies: 14
- Views: 4908
Re: OpenDoc6 works correctly only in debug mode
I also not! I managed to somehow get it to work. I do not understand one point: I have the execution of the macro code to pause until the file is opened. And my event listener doesn't make sense - it listens when things happen anyway. I was not able to simulate non-synchronous code operation. You c...
- Tue Sep 05, 2023 5:04 am
- Forum: API
- Topic: OpenDoc6 works correctly only in debug mode
- Replies: 14
- Views: 4908
Re: OpenDoc6 works correctly only in debug mode
https://blog.codestack.net/handling-solidworks-events
Try to look here. You need to create a class to track events. I haven't been able to make it work.
- Fri Sep 01, 2023 12:47 pm
- Forum: API
- Topic: OpenDoc6 works correctly only in debug mode
- Replies: 14
- Views: 4908
Re: OpenDoc6 works correctly only in debug mode
The sleep function is definitely an option I will try out. If nothing helps I have to send the problem to the API support. Perhaps tracking events will help? I have not used it, but there are such functions. DSldWorksEvents_DocumentLoadNotify2EventHandler - Post-notifies the user program when a SOL...
- Fri Sep 01, 2023 2:34 am
- Forum: API
- Topic: What is the image size for the macro button?
- Replies: 16
- Views: 4717
Re: What is the image size for the macro button?
These are 256 x 256 and work for me. Just for information, what does your 256x256 icon look like (upper left) and what does the adapted 20x20 look like (upper right). I love beautiful icons. Bottom left, as if I made myself an STL icon. On the right are examples of icons. It is very convenient to t...
- Fri Sep 01, 2023 2:06 am
- Forum: API
- Topic: What is the image size for the macro button?
- Replies: 16
- Views: 4717
Re: What is the image size for the macro button?
I think that your size 22x22 was compressed to 20x20, but it coincided that it was not visually noticeable.
- Thu Aug 31, 2023 12:24 pm
- Forum: API
- Topic: What is the image size for the macro button?
- Replies: 16
- Views: 4717
Re: What is the image size for the macro button?
We can check such options.Hansjoerg wrote: ↑Thu Aug 31, 2023 6:59 am The Austrian reseller Planet Software recommends bitmaps with 22x21. -> https://www.cad.at/wissen/blog/individu ... ks-makros/
width 22 height 21
height 21 width 22 As you can see, it turns out badly.
- Thu Aug 31, 2023 1:54 am
- Forum: API
- Topic: What is the image size for the macro button?
- Replies: 16
- Views: 4717
What is the image size for the macro button?
There is no normal specification for image size in pixels for the latest versions of SolidWorks. I did a little experiment and present the results. Ideally, the picture should be in .BMP format, white color will be perceived as a transparent background. Image dimensions should be 20x20 pixels or les...
- Fri Aug 11, 2023 7:59 am
- Forum: API
- Topic: Pack and Go Lite macro
- Replies: 6
- Views: 2239
Re: Pack and Go Lite macro
Why not use the pack and go API to get the drawings as well. You can also add prefix, suffix if needed and also add other files as well. https://help.solidworks.com/2023/english/api/sldworksapi/pack_and_go_an_assembly_example_vb.htm Perfect example. Didn't see that there is one. swPackAndGo.Include...
- Thu Aug 10, 2023 10:47 am
- Forum: API
- Topic: Pack and Go Lite macro
- Replies: 6
- Views: 2239
Re: Pack and Go Lite macro
Would it be possible to make a version of this that includes the drawings? This would become very useful if so. I don't know of a function that can find out which drawing an assembly or part file refers to without opening that assembly or part file. It can be assumed that the drawing has exactly th...
- Sun Feb 05, 2023 4:35 am
- Forum: How To Questions
- Topic: Pack and Go 2023 Duplicate filenames in red?
- Replies: 12
- Views: 5405
Re: Pack and Go 2023 Duplicate filenames in red?
Because this should never be done, ever. I would be glad PnG is preventing it from even trying to copy the structure until this issue is fixed in the files. Did I mention this should never be done, ever? You're absolutely right. There should not be 2 files with the same name and different paths in ...
- Sun Feb 05, 2023 4:34 am
- Forum: API
- Topic: Pack and Go Lite macro
- Replies: 6
- Views: 2239
Pack and Go Lite macro
The macro is a Light version of the Pack and Go function. Copies only unquenched files loaded into the Active Assembly. Allows you to decide whether to copy envelopes, if any. Doesn't copy files referenced by uploaded files, doesn't copy blueprints, doesn't copy appearances. In short, only what is o...