The surface normals are wrong. Run the following script before exporting to STEP and see if it solves the problem. I don't have Solidworks so I can't test it myself:
I installed jython but couldn't get the 'Load Script' option to show up...anyways, I had enough of messing with that so I just pasted the converted java code into the top of the 'Save As' function. Double check my code because I don't do scripting much:
int i=0;
while (i<deck.get_nr_of_segments())
{
int j=0;
while (j<deck.get_nr_of_points())
{
myPoint p = deck.get_control_point(i,j);
deck.set_control_point(i,j, new myPoint(p.x,p.y,-p.z));
p=bottom.get_control_point(i,j);
bottom.set_control_point(i,j, new myPoint(p.x,p.y,-p.z));
j=j+1;
//print (i,j);
}
i=i+1;
}
Anyways, I opened a board and hit save as and it crashed because board was null. Next time I did a 'Render Nurbs model' before saving and it saved...but Solidworks still crashed.
Am I doing this how you imagine? I was thinking for some reason the STP file created was not going to be NURBs based but maybe that's the only way to do it.
Maybe you could attach a STP file and I can try to open it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jython is available in the webstart application, but is hidden for the users. See the developer forum for more information. I'm on vacation until August 15, but as soon as I get back I'll post some step files in the developer forum so we can try them on different CAD-systems. Thanks for helping out with this!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The surface normals are wrong. Run the following script before exporting to STEP and see if it solves the problem. I don't have Solidworks so I can't test it myself:
#switch normals
import boardcad.BoardCAD
boardhandler=boardcad.BoardCAD.getInstance().getBoardHandler()
board=boardhandler.getActiveBoard();
deck=board.getDeck()
bottom=board.getBottom()
i=0
while (i<deck.get_nr_of_segments()):
j=0
while (j<deck.get_nr_of_points()):
p=deck.get_control_point(i,j)
deck.set_control_point(i,j, boardcad.myPoint(p.x,p.y,-p.z))
p=bottom.get_control_point(i,j)
bottom.set_control_point(i,j, boardcad.myPoint(p.x,p.y,-p.z))
j=j+1
print (i,j)
i=i+1
deck.evaluate_surface()
bottom.evaluate_surface()
I installed jython but couldn't get the 'Load Script' option to show up...anyways, I had enough of messing with that so I just pasted the converted java code into the top of the 'Save As' function. Double check my code because I don't do scripting much:
BoardHandler boardHandler = getBoardHandler();
Board board = boardHandler.getActiveBoard();
Surface deck = board.getDeck();
Surface bottom = board.getBottom();
int i=0;
while (i<deck.get_nr_of_segments())
{
int j=0;
while (j<deck.get_nr_of_points())
{
myPoint p = deck.get_control_point(i,j);
deck.set_control_point(i,j, new myPoint(p.x,p.y,-p.z));
p=bottom.get_control_point(i,j);
bottom.set_control_point(i,j, new myPoint(p.x,p.y,-p.z));
j=j+1;
//print (i,j);
}
i=i+1;
}
deck.evaluate_surface();
bottom.evaluate_surface();
Anyways, I opened a board and hit save as and it crashed because board was null. Next time I did a 'Render Nurbs model' before saving and it saved...but Solidworks still crashed.
Am I doing this how you imagine? I was thinking for some reason the STP file created was not going to be NURBs based but maybe that's the only way to do it.
Maybe you could attach a STP file and I can try to open it.
Jython is available in the webstart application, but is hidden for the users. See the developer forum for more information. I'm on vacation until August 15, but as soon as I get back I'll post some step files in the developer forum so we can try them on different CAD-systems. Thanks for helping out with this!
I finally got to try your script. It did not fix the issue.