Menu
Create Polylines from the Boundaries of Objects You can create a polyline from the boundaries of overlapping objects that form a closed area. A polyline created using the boundary method is a separate object, distinct from the objects used to create it. You can edit it using the same methods used to edit other polylines. To expedite the boundary selection process in large or complex drawings, you can specify a group of boundary candidates, called a boundary set. You create this set by selecting the objects you want to use to define the boundary. Click Home tab Draw panel Polyline. At the command prompt, enter pline.
![Autocad Autocad](http://www.cadoasis.com/wp-content/uploads/2014/11/createPo.jpg)
Specify the start point of the line segment. Enter w (Width). Enter the starting width of the line segment. Specify the ending width of the line segment using one of the following methods:. To create a line segment of equal width, press ENTER.
AutoCAD 2010:: Set Polyline Width - Showing Blank Lines In Other Drawing Apr 18, 2012 I have a problem in polyline width. When i set polyline width in one drawing shows solid line & in another drawing shows blank lines. In AutoCAD, a Polyline is a single object that is composed of lines and/or arc segments. How is a LINE different from a Polyline? 7 Great Apps That Let You Draw on Pictur. Tutorial45.com is a list of tutorials and great technologies by Andreea Georgiana, Aris Tchoukoualeu and friends.
To create a tapering line segment, enter a different width. Specify the endpoint of the polyline segment. Continue specifying segment endpoints as needed. Press ENTER to end, or enter c to close the polyline. Click Home tab Draw panel Boundary. At the command prompt, enter boundary.
In the Boundary Creation dialog box, in the Object Type list, select Polyline. Under Boundary Set, do one of the following:. To create a boundary set from all objects visible in the current viewport, select Current Viewport in the list. Avoid this option for large, complex drawings.
To specify which objects to include in the boundary set, click New. Select the objects that you want to use to create the boundary. Choosing this option automatically selects the Existing Set option.
Click Pick Points. Specify points within each area that you want to form a boundary polyline. This area must be totally enclosed; that is, there can be no gaps between enclosing objects. You can select more than one area. Press ENTER to create the boundary polyline and end the command. The command creates a polyline in the shape of the boundary. Because this polyline overlaps the objects used to create it, it may not be visible.
However, you can move, copy, or modify it just as you can any other polyline.
Introduction The previous days I was working on a hydraulic project and I had to design some pipelines in an AutoCAD 3D drawing. In the particular case I had the pipeline coordinates and pipe sizes in an Excel workbook, so I thought that I should write a VBA code in order to automate this procedure. I remembered that some months ago I published a VBA code for, so I started thinking a way to expand this solution in three dimensions.
The manual way for drawing a 3D “solid” polyline – which looks like a circular pipeline – in AutoCAD involves the SWEEP command (see the video below), a 3D polyline that represents the pipeline path and a circle, the radius of which corresponds to the pipe radius. Unfortunately, VBA doesn’t have a SWEEP command/method, making the procedure a little bit difficult. However, it has a similar method which called AddExtrudedSolidAlongPath. This method creates an extruded solid given the profile and an extrusion path. The new solid is extruded from the current location of the region using the translation of the path to the region’s Centroid.
From the AutoCAD VBA help we get its structure. RetVal = Object.AddExtrudedSolidAlongPath(Profile, Path) Where: RetVal: 3DSolid object – the extruded 3DSolid object. Object: ModelSpace Collection, PaperSpace Collection, Block – the objects this method applies to.
Profile object: input-only – the Region object only. Path object: input-only – the Polyline, Circle, Ellipse, Spline, or Arc object only. Remarks: You can extrude only 2D planar regions. The path should not lie on the same plane as the profile, nor should it have areas of high curvature.
Although the available path objects not include the 3D polyline, we can use this object, but taking into account the fact that both Profile and Path objects must not lie on the same plane. We can overcome this limitation with a simple trick: we rotate the Profile object! So, in the particular case, we rotate the circle 45 degrees over the y axis, in order the circle plane to be different than the 3D polyline plane(s). Moreover, we apply the Move method in order to move the 3D “solid” polyline back to its original position (since the AddExtrudedSolidAlongPath method will start drawing the 3D “solid” polyline at profile’s coordinates – usually at (0,0,0)). VBA code Here is the VBA code for drawing the 3D “solid” polyline. Note that, if the user doesn’t enter a radius value (which determines the pipe radius), the code will draw only the 3D polyline.
Option Explicit Sub Draw3DPolyline '- 'Draws a 3D polyline in AutoCAD using X, Y and Z coordinates from the sheet Coordinates. 'If the user enter a radius value the code transforms the 3D polyline to a pipe-like solid, using 'the AddExtrudedSolidAlongPath method. In this way you can draw a pipeline directly from Excel! 'The code uses late binding, so no reference to external AutoCAD (type) library is required. 'It goes without saying that AutoCAD must be installed at your computer before running this code.
'Written by: Christos Samaras 'Date: 'Last Update: 'e-mail: [email protected] 'site: '- 'Declaring the necessary variables. Dim acadApp As Object Dim acadDoc As Object Dim LastRow As Long Dim acad3DPol As Object Dim dblCoordinates As Double Dim i As Long Dim j As Long Dim k As Long Dim objCircle(0 To 0) As Object Dim CircleCenter(0 To 2) As Double Dim CircleRadius As Double Dim RotPoint1(2) As Double Dim RotPoint2(2) As Double Dim Regions As Variant Dim objSolidPol As Object Dim FinalPosition(0 To 2) As Double 'Activate the coordinates sheet and find the last row. With Sheets('Coordinates').Activate LastRow =.Cells(.Rows.Count, 'A').End(xlUp).Row End With 'Check if there are at least two points. If LastRow 0 Then 'Set the circle center at the (0,0,0) point. CircleCenter(0) = 0: CircleCenter(1) = 0: CircleCenter(2) = 0 'Draw the circle.
Set objCircle(0) = acadDoc.ModelSpace.AddCircle(CircleCenter, CircleRadius) 'Initialize the rotational axis. RotPoint1(0) = 0: RotPoint1(1) = 0: RotPoint1(2) = 0 RotPoint2(0) = 0: RotPoint2(1) = 10: RotPoint2(2) = 0 'Rotate the circle in order to avoid errors with AddExtrudedSolidAlongPath method. ObjCircle(0).Rotate3D RotPoint1, RotPoint2, 0.785398163 '45 degrees 'Create a region from the circle.
Regions = acadDoc.ModelSpace.AddRegion(objCircle) 'Create the 'solid polyline'. Set objSolidPol = acadDoc.ModelSpace.AddExtrudedSolidAlongPath(Regions(0), acad3DPol) 'Set the position where the solid should be transfered after its design (its original position). With Sheets('Coordinates') FinalPosition(0) =.Range('A2').Value FinalPosition(1) =.Range('B2').Value FinalPosition(2) =.Range('C2').Value End With 'Move the solid to its final position. ObjSolidPol.Move CircleCenter, FinalPosition 'Delete the circle. ObjCircle(0).Delete 'Delete the region.
Regions(0).Delete 'If the 'solid polyline' was created successfully delete the initial polyline. If Err.Number = 0 Then acad3DPol.Delete End If End If 'Zooming in to the drawing area. AcadApp.ZoomExtents 'Release the objects. Set objCircle(0) = Nothing Set objSolidPol = Nothing Set acad3DPol = Nothing Set acadDoc = Nothing Set acadApp = Nothing 'Inform the user that the 3D polyline was created.
MsgBox 'The 3D polyline was successfully created in AutoCAD!' , vbInformation, 'Finished' End SubThe above code was successfully tested in Excel and AutoCAD 2013 (both 32bit). However, it should work in other Excel/AutoCAD versions. Demonstration video The short video below demonstrates both the manual (using SWEEP command) and the automatic way (Excel VBA) to create a 3D solid polyline in AutoCAD.