X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Futils%2FComponentUtils.java;h=939d1551a5343e20526b9db50e0ad87039a43dc8;hb=8f71b333e7b1d116e55c2d39054aeb90dd93028d;hp=50ede807e6dac4039e2aee555174a088df24c80a;hpb=e96447c877fd9c3a4664c2593cfbae768d0c44d7;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java index 50ede807..939d1551 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java @@ -408,12 +408,18 @@ public class ComponentUtils { pipeRun.addChild(newComponent); - if (newComponent instanceof InlineComponent && ((InlineComponent)newComponent).isVariableLength() ||((InlineComponent)newComponent).isModifialble()) { - newPcp.setLength(inst.length); - newComponent.setParameter("length", inst.length); - } else if (newComponent instanceof TurnComponent && ((TurnComponent)newComponent).isVariableAngle()) { - newPcp.setTurnAngle(inst.angle); - newComponent.setParameter("turnAngle", inst.angle); + if (newComponent instanceof InlineComponent) { + InlineComponent inlineComponent = (InlineComponent)newComponent; + if (inlineComponent.isVariableLength()|| inlineComponent.isModifialble()) { + newPcp.setLength(inst.length); + newComponent.setParameter("length", inst.length); + } + } else if (newComponent instanceof TurnComponent) { + TurnComponent turnComponent = (TurnComponent)newComponent; + if (turnComponent.isVariableAngle()) { + newPcp.setTurnAngle(inst.angle); + newComponent.setParameter("turnAngle", inst.angle); + } } newComponent.updateParameters();