451 questions
0
votes
0
answers
58
views
Marshal.GetActiveObject Fails with error code 0x800401E3
I am attempting to connect to SolidWorks via this code:
Dim swApp As SolidWorks.Interop.sldworks.ISldWorks = _
TryCast(System.Runtime.InteropServices.Marshal.GetActiveObject("SldWorks....
0
votes
0
answers
75
views
In Solidworks VBA Code, how do I dimension a sketch from an unnamed edge?
I'm making a code in SolidWorks VBA that will automatically model revolved rectangles onto an imported conical solid body with an axis going up the middle. The revolves are placed on angled planes ...
0
votes
1
answer
122
views
Using Solidworks VBA code, how do I create a reference plane at a specified angle from the Top Plane?
I am attempting to do some Solidworks automation to create some revolved features using an excel spreadsheet for the dimensions.
I’ve deduced the error with my code was with the creation of the ...
0
votes
0
answers
38
views
How can I make a spiral cone with variable radius?
A spiral cone with a parameterized radius
Hello,
I am struggling with filling the cone in the attached image. I drew the spiral line with a curve through XYZ points. The radius is parameterized, and I ...
0
votes
0
answers
34
views
How to distinguish holes drawn using extrude cut?
In SOLIDWORKS, for a hole drawn by the wizardHole, it can be easily obtained through the hole feature in SOLIDWORKS, and its diameter and hole type can be obtained, but the hole drawn by extrusion cut,...
0
votes
0
answers
183
views
Python code to open a .sldprt and .sldasm file using solidworks whose shortcut is located in a different location
def open_file():
"""
Open a file dialog to select a file and launch SolidWorks for supported files.
"""
# Specify the SolidWorks shortcut location (modify ...
0
votes
0
answers
119
views
Why don't save 'Extension.SaveAs3' the step without new coordinate system?
I often get step-files. The coordinate system will never be the same. So I searched for solutions, that transform the main coordinate system into another. I found a good solution here on Stack ...
2
votes
0
answers
106
views
Retrieving a Hebrew folder path using VBA 7.1
I get wrong characters and "???" instead of Hebrew when trying to retrieve a folder path using VBA (by user browse selection) then plot it with question marks.
I changed the locale. Is there ...
0
votes
1
answer
106
views
Messagebox for overwriting files does not pop up
I have written the following VBA code to save my Solidworks files. It also checks if files already exists in the folder and if so - asks through a messagebox if these files need to be overwritten.
...
1
vote
2
answers
92
views
Use string in another sub
I am aware I'm not the first to have this question. Still I cannot find the solution.
I have some vba code for my solidworks, that works fine. However, I want to use a string that I defined in one sub,...
0
votes
1
answer
124
views
Group Textboxes to create an array in VBA
I want to automatically save solidworks files within an assembly. The names of each parts that will be saved is created based on the input given in a userform.
The user can determine the amount and ...
1
vote
1
answer
80
views
Files overwriting messagebox in a loop using VBA
I have a working script that saves multiple Solidworks parts through a loop using vba. The amount and name of parts is dependent on the user that selects parts to be saved in a userform.
If files are ...
0
votes
1
answer
126
views
Overwrite files msgbox within a loop using Solidworks vba
I have a script that saves x amount parts of a SW assembly into step/xt, based on the input of a userform.
This works really well. However, I want to add a messagebox that asks "Do you want to ...
0
votes
1
answer
110
views
Create loop to save files using a variable array in VBA Solidworks
I want to save multiple files at once. Based on checkboxes in a userform, an array called ArrayParts is created. Each checkbox contains the name of the file that the user wants to save.
My code gets ...
0
votes
0
answers
39
views
Save Solidworks part as XT using VBA userform does not work
I created a VBA userform (named UserParam) to save my Solidworks files.
The userform contains among others two options: save as .STEP or as .XT.
I used the following codes, but only the .STEP ...
0
votes
1
answer
215
views
How to rename a solidworks features from its properties?
I'm making VBAs to clean the feature tree and automate some process in the way to lighten the work on big welded structures.
Every weldment and sheetmetal features in my cutListFolder have a property ...
1
vote
1
answer
105
views
Display amount of features in SolidWorks with similar names in Excel using vba
I want to communicate information between SolidWorks and Excel using vba back and forth. I managed
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings ...
0
votes
1
answer
170
views
Can't set SolidWorks Custom addin to Active
I have created a new version of a custom addin for SolidWorks. The addin adds a tab to the CommandManager which contains a bunch of buttons to macros. I have previously updated it without issue. ...
0
votes
1
answer
150
views
How to get the plane of the hole using solidworks API?
I want to get the plane where the hole is located, I try to get the face through the feature, but it is the face inside the hole feature, not the plane where the hole is located. Later, I pass the ...
1
vote
1
answer
279
views
Call of Solidworks PDM API GetFileFromPath in a vbscript script
I'm writing a simple script to count the number of referenced files giving a file in a vault of Solidworks PDM.
I get a Type mismatch error in GetFileFromPath method which has the following ...
1
vote
0
answers
82
views
How can I adjust the value of a heat source’s heat generation rate using VBA?
I directly add volumetric heat sources from a VBA program using APIs.
I would like to modify Q (Heat Generation Rate).
My goal is to automate thermal simulations for a part composed of two solid ...
0
votes
2
answers
327
views
Is there a way to change the Solidworks properties after a drawing has been placed through VBA
I'm trying to update a Solidworks VBA script to adjust properties of a view after it has already been placed and am unsure how to actually do this. In the GUI once I select the view I can edit these ...
0
votes
1
answer
385
views
How can I activate a model window if it is already open? Solidworks VBA
I am trying to find a way to automatically open the model the drives Drawing View 1. I have the following code which opens the model if it is not open already, but if it is already open, does not ...
0
votes
1
answer
486
views
Saving SolidWorks files inside PDM vault
I'm creating a SolidWorks VBA macro to name and save new models inside the PDM vault. The macro uses the built in SaveAs3 method and allows the user to select various save options: Save as, Save as ...
0
votes
1
answer
173
views
Trying to split object with a dovetail connector and stopper
I'm trying to split my model in the style of a dovetail using a stopper layer at the bottom. The front half will be removable and then placed on the back half with the stopper layer preventing gravity ...