Preview | SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
LMLuke Malpass09/04/2008
OK, this seems to be a definate bug in SW.
Say you are in an assembly, and you get the selected part, from that you get the component, and from that you get the feature (such as a sketch or plane within the part).
This is all fine, I have a successful handle to features of the part.
If I encounter a sketch I then call: Feature::Select2(false, -1)
This successfully selects the sketch, and calling Model::UnBlankSketch() shows it for example, fine.
Now on to reference geometry; I get a feature of type "PLANE", so again, I call Feature::Select2(false, -1), which reports back OK.
With the plane successfully selected, I call Model::UnBlankRefGeom(), which doesn't report any errors, and yet does nothing.
So, to test everything is OK and selected, instead of calling Model::UnBlankRefGeom(), I call Model:
eleteSelection(True), which pops up with a dialog box asking if I
want to delete Plane2 (as an example), if I select OK it deletes
it.
Even calling Model::EditSuppress2() suppressed the planes. Everything works on the selection except hiding/showing it!
So, finally, it shows that the selection is OK, the UnBlankSketch works, the selection of planes and deletion of planes is OK, yet the UnBlankRefGeom does nothing.
The way I get around this for a test of the function is to call SelectByID2() from the Assemblies model, manually type that planes ID in so it visually selects in SW, then call the assembly models UnBlankRefGeom(), which works. The big problem with this is there is no way to find the ID of Feature to start with, plus the HUGE performance overhang of using SelectByID2 on a root level for every reference geometry. The fact is the exact same code using UnBlankSketch works, yet replace with UnBlankRefGeom when its reference geometry and nothing happens.
Anyone ever noticed this or could try it out for me? I have tested on 2007 and 2008.
Say you are in an assembly, and you get the selected part, from that you get the component, and from that you get the feature (such as a sketch or plane within the part).
This is all fine, I have a successful handle to features of the part.
If I encounter a sketch I then call: Feature::Select2(false, -1)
This successfully selects the sketch, and calling Model::UnBlankSketch() shows it for example, fine.
Now on to reference geometry; I get a feature of type "PLANE", so again, I call Feature::Select2(false, -1), which reports back OK.
With the plane successfully selected, I call Model::UnBlankRefGeom(), which doesn't report any errors, and yet does nothing.
So, to test everything is OK and selected, instead of calling Model::UnBlankRefGeom(), I call Model:

Even calling Model::EditSuppress2() suppressed the planes. Everything works on the selection except hiding/showing it!
So, finally, it shows that the selection is OK, the UnBlankSketch works, the selection of planes and deletion of planes is OK, yet the UnBlankRefGeom does nothing.
The way I get around this for a test of the function is to call SelectByID2() from the Assemblies model, manually type that planes ID in so it visually selects in SW, then call the assembly models UnBlankRefGeom(), which works. The big problem with this is there is no way to find the ID of Feature to start with, plus the HUGE performance overhang of using SelectByID2 on a root level for every reference geometry. The fact is the exact same code using UnBlankSketch works, yet replace with UnBlankRefGeom when its reference geometry and nothing happens.
Anyone ever noticed this or could try it out for me? I have tested on 2007 and 2008.