Model.lineeditlength#
- Model.lineeditlength(entity, length, derivative, direction)#
Changes the length of a single free line. If a closed line is selected, one can only make its new length shorter. If the new length is chosen to be less than 1 tenth of the cleanup tolerance of the model, the line is deleted to avoid creating lines that are too short to be compatible with the model tolerance.
- Parameters:
entity (Entity) – The object describing the free line entity to edit.
length (double) –
The new length of the line.
If a closed line is selected, one can only make its new length shorter.
If the new length is chosen to be less than 1 tenth of the cleanup tolerance of the model, the line is deleted to avoid creating lines that are too short to be compatible with the model tolerance.
A negative length is interpreted as first making the length of the line 0.0, in the direction given, and the extending in the opposite direction with the absolute value of the given length.
derivative (int) –
This option is used only when the new length is longer than the current length of the line. Valid values are:
1 - A straight line extension is made that is tangent to the line
2 - The extension follows the curvature of the line as well
direction (int) –
-1 - The change is made at the start point of the line, that is in the reverse direction to the direction of the line.
1 - The change is made at the end point of the line, considering the 0.0 length as the start point of the line.
Example#
Edit the length of line with ID 1142 , so that its new length is 80.0 . If the line is made longer by this change , the extension is made only tangentially . The change is made at the start point of line#import hm import hm.entities as ent model = hm.Model() model.lineeditlength( entity=ent.Line(model, 1142), length=80.0, derivative=1, direction=-1 )