I want to write a small programme that can automatically draws the part. The problem now is that I don't know how to use Holewizard to add several holes at one time.
I try to preselect a point on the face, then use holewizard to create a hole, then edit the sketch and add the rest of the hole.(I wonder if there is a better way to do this.)
Suppose I have a part file below.The arrow is the only point in the Sketch3.
The following is my code (I use Vs2008 C++ to develop sw2012):
|CoInitialize(NULL); // initialize COM|
|HRESULT hres = swApp.CoCreateInstance(__uuidof(SldWorks), NULL, CLSCTX_LOCAL_SERVER);//CLSCTX_LOCAL_SERVER|
|hres = swDocExt->SelectByID2(L"Sketch3",L"SKETCH",0.0,0.0,0.0,VARIANT_FALSE,0,NULL,swSelectOptionDefault,&bRetbool);|
// This doesn't work. Cause it's invisible? Or I made other mistakes? Even if I specify the type argument as "SKETCH".,finally
the Origin Point is selected.
|//hres = swDocExt->SelectByID2(L"Point1@Sketch3",L"EXTSKETCHPOINT",1.13,1.25,0.0,VARIANT_FALSE,0,NULL,swSelectOptionDefault,&bRetbool);|
|//This sentence may work if I manually show the hiding Sketch3. But I don't think it's a good way.|
Thanks for any suggestion in advance!