PDA

View Full Version : Get Bulge Factor of 2D Polylines



Lions60
2006-08-17, 02:45 PM
I am working with drawing containing multiple arcs that will be converted to 2d polylines and am wondering on how to actually get the bulge factor they are currently at and how to set the bulge factor for the arcs.

Also is there anyway to change or set a bulge factor after an object has already been created as a 2d pline.

rkmcswain
2006-08-17, 02:53 PM
Go to http://www.faqs.org/faqs/CAD/autolisp-faq/part2/ and search the document for "What is the *BULGE* in a polyline"

There is a good explanation and some sample code.

Tom Beauford
2006-08-17, 06:51 PM
I am working with drawing containing multiple arcs that will be converted to 2d polylines and am wondering on how to actually get the bulge factor they are currently at and how to set the bulge factor for the arcs.
Doable but it's the hard way. Why not use the multiple option of pedit? What version of Autocad are you running? I've converted bulge info the other way for listing and labeling.

Also is there anyway to change or set a bulge factor after an object has already been created as a 2d pline. For an arc segment it's easy enough, but since the group codes repeat for each segment of a lwpolyline accessing a paticular bulge of one with multiple segments can be a pain.

jwanstaett
2006-08-17, 08:52 PM
Also is there anyway to change or set a bulge factor after an object has already been created as a 2d pline.use the ActiveX functions where

vlaobject is the pline as a vla-object
use the (vlax-ename->vla-object entname) functions to set vlaobject to the pline.

Index
Integer; input-only
The index location of the vertex you wish to set. The first vertex is index 0.

Value
Double
The bulge value for the vertex at the given index.

(VLA-GETBULGE vlaobject Index)
(VLA-SETBULGE vlaobject Index Value)



Note: The (vl-load-com) function need to be called be for you can use the vla-functions.

Lions60
2006-08-21, 12:53 PM
I am using Autocad 2006 and i am not familliar with using the ActiveX commands. I have only been using the basic lisp commands.

jwanstaett
2006-08-21, 01:07 PM
I am using Autocad 2006 and i am not familliar with using the ActiveX commands. I have only been using the basic lisp commands.
well how a good time to start using the ActiveX commands of lisp you will find them helpful.

Tom Beauford
2006-08-21, 01:24 PM
I am using Autocad 2006 and i am not familliar with using the ActiveX commands. I have only been using the basic lisp commands.Start with pseudocode. Basicly show us the step by step proceedure of what you want the routine to do. That will get responces of the easiest way to get the results you're looking for. Someone may have already written this routine or something close.

Lions60
2006-08-21, 07:18 PM
Is it possible to get and change the bulge factor of a 2d polyline. If so I would like to the program to get all 2d polylines and change the bulge factor so that when the pline arc segments are inserted into another program they are not drawn as straight lines.

Opie
2006-08-21, 07:36 PM
Is it possible to get and change the bulge factor of a 2d polyline. If so I would like to the program to get all 2d polylines and change the bulge factor so that when the pline arc segments are inserted into another program they are not drawn as straight lines.
How do you plan on determining when the bulge factor needs to be changed? Was this post not helpful?

Tom Beauford
2006-08-21, 07:37 PM
Is it possible to get and change the bulge factor of a 2d polyline. Yes, as noted before.
If so I would like to the program to get all 2d polylines and change the bulge factor so that when the pline arc segments are inserted into another program they are not drawn as straight lines. Each vertex has a bulge factor, if negitive it bulges the opposite way. You don't want to set the bulge for every lwpolyline vertex in the drawing the same without any straight segments. You will need to calculate the bulge for each segment. Show us the step by step proceedure of what you want the routine to do. That will get responces of the easiest way to get the results you're looking for. Someone may have already written this routine or something close.

Lions60
2006-08-22, 04:29 PM
Step1: Get all 2d polylines
Step2: Evaluate the bulge factor for each vertex
Step3: Extract the Bulge factor data to an excel file and link it to ACAD
Step4:Close the program so i can then go and look at the data extracted.

Tom Beauford
2006-08-22, 05:04 PM
Step1: Get all 2d polylines
Step2: Evaluate the bulge factor for each vertex
Step3: Extract the Bulge factor data to an excel file and link it to ACAD
Step4:Close the program so i can then go and look at the data extracted.For starters enter this at the command line:

(entget (car (nentsel "\nSelect Polyline: "))) to look at a polylines entity list. 42 is the entity code for the bulges. More info can be found in the DXF Reference section of Developer Help. For straight segments the values will be 0.0. Since Autocad draws arc segments counter-clockwize the clockwize ones will have negitive values. Still not clear what you're looking for in an end product.