I would like to traverse a design tree and locate any under defined sketches. Is there a member that gets the sketch state of defined or under defined?
2017 SOLIDWORKS API Help - GetConstrainedStatus Method (ISketch)
Use the Design Checker:
Build a check that only checks for fully defined sketches. Then uncheck all the others in the left tab and click "Check Document":
I am not for Dassault adding new fangled features like this... I'd rather they focus on ONE and TWO . But, I have to admit that using the Design Checker to find undefined sketches is pretty slick.
Ive used the Design Checker for this but it requires a Premium license. We only have (3) of those licenses. I would rather create a macro that anyone can use, regardless of the type of license in use.
Look for minus sign
I'm looking for a way to do this programatically.
What is your end need with finding those sketches?
Hello Deepak. The end need is to have the user fully define them. I know they could use the Fully Define Sketch command but I want the user to define the sketch using design intent, so the macro will simply tell them the sketch names that are not fully defined. I found the example macro below. I'm looking to see if I could use the FullyDefineSketch method to possibly tell me if a sketch is not fully defined and not have the command fully define the sketch.
2017 SOLIDWORKS API Help - Fully Define Under Defined Sketch Example (VBA)
Sorry, I'm not too good with programming. It'd take me a day or two to put something together. Maybe Deepak Gupta or someone who knows more about the API will drop in and offer a solution.
Thanks Ivana, was about to post the same method .
Thanks! Thats what I was looking for. I took the example 'Traverse and Hide All Sketches' macro and instead of hiding the sketch, I am checking the constrained status. Thanks again.
Retrieving data ...