Found the problem. "app as Application.SldWorks" needs to be "app as SldWorks.SldWorks.", then the type mismatch error goes away.
I'll correct the other error you pointed out as well. Thanks.
Thanks for the response. To answer your question:
The first line of the function is the problem (Function IsPartOpen).
Yes, there is a part open.
The function tests whether a part is open.
I am confused as to why I am getting a type mismatch here. Any insight would be greatly appreciated.
-------
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
MsgBox IsPartOpen(swApp)...
You would need to change the units of the document, which would then change the custom property units.
If the custom property type is Number then you are stuck with 6 decimal places. That is a known bug. If you use Text, however, then you can change the decimal places.
To do all of this...
Have you taken the Assembly Modeling class offered by your VAR? Smart components are covered. Otherwise Smart Components are covered in the Tutorials. Go to Help-->Tutorials, and then look under All SoidWorks Tutorials (Set 2). What you have described doesn't sound complicated at all so I'm sure...
The problem ending up being that given the above macro, multiple sheets with the same name would have existed. I changed it to first change all of the sheet names to something odd and then go back through make them Sheet1, Sheet2, ... etc
I am at a loss to explain why the following does not work. GetCurrentSheet is not getting the sheet even though that sheet is active. Any ideas? Thanks for your help.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swSheet As SldWorks.Sheet...
I have run into this before; in my research I could not find a way to accomplish this. Maybe someone else has a trick or roundabout way but unfortunately there is nothing as simple as an anchor button the dimension property manager.
Actually, if you don't mind I have a followup question: what is the purpose of the CreateSelectData method and the ISelectData interface? I see it used in conjunction with marking a lot but looking over the examples I can't tell why it's used exactly. Thanks.
Here is what I'd like to do: run through every face in the visible bodies. If a face is blue (B = 1) then mark it. Once all faces have been traversed, select all marked faces.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swPart As SldWorks.PartDoc
Dim swBody As Variant...
Hi,
The mate references in "screw.sldprt" are set up in a fairly sensible fashion, and yet when I drag them onto a hole in the assembly they are not recognized. Sometimes I can switch the order and get the face to recognize a coincident mate, but I'm trying to get the "drop in hole" mate icon...