Continuous Rotation of fan
Hello,
I am working on fan model where I just want to rotate the fan blades continuously and not its outer cover until I click on stop button. So, can anyone suggest any solution for the same?
Hello,
I am working on fan model where I just want to rotate the fan blades continuously and not its outer cover until I click on stop button. So, can anyone suggest any solution for the same?
It might be easier to do this entirely in Javascript instead of using a sequence that gets repeated. First, you'll need to make a modelItem corresponding to the fan blade separate from the housing or any other assembly components that you don't want to spin. Suppose that modelItem is "modelItem-1". Then you could use code something like this:
$scope.fanInterval = null;
$scope.startFan = function() {
var fanStep = 20; // adjust this to control fan speed
$scope.fanInterval=$interval(function() {
// you might need to replace "rx" below with "ry" or "rz" depending on
// how your CAD model is oriented
$scope.setWidgetProp("modelItem-1", "rx", parseInt($scope.view.wdg["modelItem-1"]["rx"]) + fanStep);
}, 10);
}
$scope.stopFan = function() {
$interval.cancel($scope.fanInterval);
}
Then attach your startFan() and stopFan() functions to whatever buttons, event listeners, etc. you want in order to control the fan.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.