Can sw be programmed to automaticaly open mechanical desktop 2004 dwg files as parts/models? (assume there is a model in "model space" in the dwg).
I'm using 2011 sp3.0, vba. I've tried loadfile4 and FeatureManager.InsertDwgOrDxfFile and turning on/off various settings. And the closest to a part/model i get is a sketch. But if I "manually" open a dwg, it goes into the wizard, and ultimately it will open with a model. The following code snippet will open the dwg in a part with a sketch, but no model:
Set importData = swApp.GetImportFileData(sFName)
importData.ImportMethod("Model") = 2
importData.ImportMethod("LAYOUT") = 0
importData.ImportMethod("USED IN") = 0
swApp.SetUserPreferenceToggle swUserPreferenceToggle_e.swImportSolidSurface, True
swApp.SetUserPreferenceIntegerValue swUserPreferenceIntegerValue_e.swCreateBodyFromSurfacesOption, swGeneralImportTryFormingSolids swApp.SetUserPreferenceIntegerValue swUserPreferenceIntegerValue_e.swImportCurvePreference, swGeneralImportAs3dCurves
Set newDoc = swApp.LoadFile4(sFName, "i", importData, longerrors)' the letter seems to make no difference
attached is an example. thanx for any help.
SolidworksApi macros