0

I am trying to create a knowledge template, such that when I choose a string value from a dropdown list of a multiple value parameter, the reaction fires according to the selection. For example, if I select "no cut", no pocket features are created. (or deleted if they already exist) If I select "top cut", a predefined sketch is used to drive the pocket feature. However, where I'm stuck, is that I want to define a "bottom cut" by changing the orientation of a positioned sketch. I envision it like this:

  1. "bottom cut" selected from drop down list
  2. change sketch support would be initiated
  3. "Reverse V" would be selected
  4. sketch would be flipped around the xy plane
  5. If "both top and bottom cut" is selected, it would return the sketch to top position (uncheck "Reverse V") and mirror the resultant pocket around XY

I have managed to accomplish everything but the "Reverse V" of "Change Sketch Support". No idea at all what is the best way to accomplish this.
So far, I've created both Knowledgeware actions, and VB actions. Open to any and all suggestions on this one.

Thank you.

bated
  • 960
  • 2
  • 15
  • 29
Mhan7
  • 1
  • 3
  • Welcome to SO - please provide the relevant code. – bated Sep 13 '17 at 17:09
  • I can't provide the relevant code. The API for this operation isn't exposed. The best I can give is an algorithm above, and hopefully somebody knows the method to achieve this. Thanks for the welcome. – Mhan7 Sep 13 '17 at 17:39

1 Answers1

0

Regarding that API for flipping objects orientation are not available, I suggest that you base your sketch orientation on a feature that can be easily flipped:

  • Create a line based on two "coordinates" points
  • Use positioned sketch and specify the support plane, the origin point, and orientation for the V direction by using the previously created line
  • You can now control the points coordinates to change the orientation of the line, and the sketch will follow.

The code will be simple, and the solution is very stable.

Assuming that the reference line is based on two points {0,0,0} and {x,0,0}, the code would be

if TopOrientation
{
    GeoSet1\RefPoint\X=1mm
}
else
{
    GeoSet1\RefPoint\X=-1mm
}

I hope it will help you.

P.Manthe
  • 960
  • 1
  • 5
  • 12
  • That's an interesting approach. I'm going to try this, but instead of using a line, I'll try to invert a normal of a plane. Will report back. Thank you. – Mhan7 Sep 14 '17 at 13:47