Example: Create a Line using the New Object Dialog

News!  Manifold Future editions no longer use the New Object dialog, and instead have introduced a new editing system.  See the videos on the Gallery page for examples of use.   This topic will be updated shortly.

 

In this example we create a line in a drawing using the New Object dialog.   

 

We begin with a new, blank drawing.  We  right-click into the Project pane and choose New Drawing and then we double-click on that new drawing to open it in a window.

 

eg_newob02_00.png

In the toolbar we choose the Create Line tool.  

eg_newobj01_02.png

We then press Ctrl-? to open the New Object dialog.   It opens in Add mode with none of the segment tools as yet chosen since we have yet to click into the drawing to add any coordinate points.

 

When we move the mouse cursor over the dialog the dialog will automatically become active and get the focus.   When we move the mouse cursor over the drawing, the drawing will get the focus.

eg_newobj01_03.png

If we move the mouse cursor over the drawing and click a coordinate point appears to mark the beginning of the line in blue preview color.  At the same time, the Line tool for creating straight line segments, the default, is enabled in the dialog and a record giving  the coordinates of the first coordinate point appears in the dialog.   With each click a new coordinate point for the line will appear.

 

As we move the cursor in the drawing a temporary line will extend from that first coordinate point to follow the moving mouse cursor, which has changed into a + cross cursor.

eg_newobj01_04.png

We click at another position to create another coordinate location to define the first segment for the line.     We then click again at another location to define another coordinate location to define the second segment, growing the line by one more segment.   With each click another record is added to the dialog giving the coordinates of that additional coordinate.  

eg_newobj01_05.png

We now move the mouse cursor into the dialog.   It changes to the usual arrow cursor when over the dialog.  

 

We press the + button to switch from Add mode and into coordinate Edit mode.  

eg_newobj01_06.png

When we do so the last coordinate location in the drawing becomes highlighted with an extra large editing square.    We can click and drag it to move it, or we can choose another coordinate to move.

eg_newobj01_07.png

When the dialog is in coordinate Edit mode, mouse moves outside the dialog do not result in more segments added to the line.   We can choose a coordinate to move by either clicking on it in the drawing window or by clicking on the record for it in the dialog.   In the screenshot above we have clicked on the second record and thus the editing handle moves to the second coordinate in the proposed line in the drawing window.

eg_newobj01_08.png

In the drawing window we can click and drag the editing handle to move that coordinate to a different location, thus changing the shape of the proposed line.

eg_newobj01_09.png

When we release the click and drag motion the coordinate moves to the new location and the coordinate values for that coordinate in the dialog are updated.

 

Moving the mouse cursor back into the dialog we click the + Add button to go back into Add mode so we can add more coordinates, and thus more straight segments, to the proposed line.  Note that the editing handle disappears from the line.

eg_newobj01_10.png

When the dialog is in Add mode any mouse moves outside the dialog are interpreted as adding to the line.   In the illustration above the second coordinate is the anchor coordinate in the dialog, as seen by the dark row handle and dotted outline on the second record.   Any additional coordinates we now add will come after that second coordinate but before the existing third coordinate.  

 

As we move the mouse cursor outside of the dialog the line segments will rubber-band to where the mouse cursor is moved.  In the illustration above the mouse cursor has been moved to the right of what was a segment between the second and third coordinates, so the line is kinked outwards to where a new coordinate would be placed if we click at that position of the mouse cursor.

 

If we want to grow the line onward from the last coordinate in the line, that is easy to do:  we move the mouse back into the dialog and click onto the last record to choose it as the anchor for the next coordinate to be added.

eg_newobj01_10a.png

We move the cursor back into the dialog and we click on the third coordinate row.

eg_newobj01_10b.png

When we click on the third row the third coordinate becomes the anchor coordinate.  The row handle for the last record becomes darkened and a dotted outline appears around the last record.

eg_newobj01_11.png

When we move the mouse cursor back onto the drawing the straight segment that rubber-bands to follow the mouse cursor will issue from the last coordinate.

eg_newobj01_12.png

We click into the drawing to create one more coordinate defining our proposed line.

eg_newobj01_13.png

To create the line, that is to save the changes we have made we can either press the Add Line button in the dialog or we can right-click into the drawing and choose Save Changes.      To abandon the proposed line we can right-click into the drawing  and choose Undo Changes.

 

eg_newobj01_14.png

 

When we press the Add Line button the dialog closes and a new line appears in our drawing.

 

This example continues onward in the related Example: Create a Line using Curved Segments topic.

Notes

 

eg_newobj02_30.png

 

Zillions of digits after the decimal point - Why are the coordinate numbers in the illustrations relatively short numbers like 199.5 or 177.5 but sometimes when we try to repeat this example the numbers have many digits after the decimal point as in the illustration above?   See the Notes in the New Object Dialog topic for a discussion.

 

See Also

Drawings

 

Coordinates

 

New Object Dialog

 

Example: Create a Line using Curved Segments - Creating a line made up from curvilinear geometry using the New Object Dialog.

 

Example: Create an Area with a Hole - Using the New Object Dialog, create an area in a drawing where the area includes one or more holes.  This is similar to how we create areas that have islands as part of the area.   

 

Example: Create an Area with Holes and Islands - Using the New Object Dialog, create an area in a drawing where the area includes holes and also islands.

 

Example: Create a Multipoint - How to create multipoints using the New Object Dialog.  This topic provides two examples:  First we create a multipoint and then next we create a multipoint having two branches.  The purpose of this topic is to help teach the implementation of geometry in Manifold and other typical spatial packages using a somewhat unusual and rarely met object type, the multipoint, which combines what appear to be many separate points into a single multipoint object.