AutoCAD Visual LISP / AutoLISP :: Change Length To Match Length
May 24, 2002Command to make a line change length to match length of a line, arc, polyline or circle? Could use this when making flat patterns layouts.
View 5 RepliesCommand to make a line change length to match length of a line, arc, polyline or circle? Could use this when making flat patterns layouts.
View 5 RepliesI need a Reactor to Modify Xdata - Length - contained in Line Object if this Line is modified (stretched, breaked, trimmed, etc).The routine need to verify if Line contain Xdata and modify it (and works with multiple selection).
I tried for long hours, but without success. I tried to create a list of entities while the reactor is applied, but doing so need another reactor to change these entities after the first Reactor works.The codes I used are below:
{code}
;If it just 1 string only you want to add
(defun add_xdata_str (e a v);;;EName APPID String_value
(and (not (tblsearch "APPID" a))
(regapp a))
(and (= (type e) 'ENAME)
[code]....
Is there any simple code for to sum length of lines which is i am choosing and copying result to chosen attribute tag ?
View 1 Replies View RelatedI am trying to create a report of line lengths based on linetype.
I have built a list that looks like this...
(("CUT4SS" . 859.566) ("CUT4SS" . 862.231) ("CUT4SS" . 927.651) ("CUT6SS" . 1158.48) ("CUT6SS" . 509.903) ("CUT6SS" . 2840.31) ("CUT4SS" . 967.76) ("CUT4SS" . 508.73) ("CUT4SS" . 111.065) ("CUT4SS" . 483.216))
I want to take this list and create a function to create a list of total lengths i.e. the CDR's.
(("CUT6SS" .total length)("CUT4SS" . total length))
Is there any way to retrieve the arc length from Revision cloud and how can we identify that object is a Revision Cloud.
View 9 Replies View RelatedI am trying to revise an old dialog box so that I can add some new options but I'm finding it difficult to shorten the label for a radio button enough to get the box width to look reasonable. I read somewhere that Windows fonts cause the label lengths to hold extra space for each character. The webpage that I found this on said the solution was to make a new line for the label, which sounded great to me, but they did not tell how to do it. After much searching, I figured out how to add an additional line to the label, but my program now refuses to function correctly. I set the middle button before initiating the dialog in my lisp, but when I select a different option, the original button remains selected along with the user's choice. The program actually works, using the last button selected, but I really want the button to respect the pick by the user and deselect the default button.
This worked perfectly when I had only two selections, and it still worked perfectly when I added the third option, but it just doesn't like it when I try to add a new line for the long description in the middle of a radio column.
I'm barely functional with dialog boxes..
DCL in question:
:boxed_radio_column { label = "Location"; width = 20; height = 2; fixed_width = true; fixed_height = true; alignment = top; :radio_button{key = "sl-AD"; label = "Spring Lake Applications";} :text_part{label = " and Distributor Services";} :radio_button{key = "sl-BP"; label = "Spring Lake BP Systems";} :radio_button{key = "gr"; label = "Grand Rapids";} }
lisp has the following in this order:
load dialog - I have a loading function that works fine
(set_tile"sl-BP""1")
(action_tile"sl-AD" "(TGW-Setup_01 $key)")
(action_tile"sl-BP" "(TGW-Setup_01 $key)")
[Code] .....
Of course, these are just the pertinent sections of a much larger setup dialog, but I didn't think I needed to post all the functions that this program is doing, since you'd have a difficult time running this without my templates, printers and a number of support files.
Like I said, it seems to be choking on my adding :text_part { Label = " and Distributor Services";} instead of making this a single line of the label for the button above it.
Why does this cause the default radio button to stop releasing?
Lisp to draw a line along the length of a 3d solid? I have some UB (I sections) columns and beams modeled and would like to select all solids and for it draw a centerline end to end
View 7 Replies View Relatedwhere I can obtain a freeware lisp routine that lists the lengths of all the polylines on a specific layer or within a selection set? I want to avoid list if possible as there are rather a lot of polylines!
View 2 Replies View RelatedMy goal is to be able to select a line and a dimension and then have the line's length appear as the text override for the dimension. I have the code to substitute the variable "dist" for the dimension text:
(setq dimselected (entsel "
Select Dimension:"))
(setq newlength dist)
(command "dimedit" "n" newlength dimselected "")
but am having problems extracting the line's length to the variable and setting setting it equal to the variable. To make things more interesting, the value needs to be in inches with fractional inches accurate to 1/16".
I need a lisp which is i can draw a line or pline with circle in every 30 meters ( circle diameter and total line or pline length will be optional )
View 6 Replies View RelatedIs there any utilities that can select the entire drawing with the 2d polyline and erase all the polyline less than specify length (eg:10m,20m etc) ?
View 4 Replies View Relatedi need any lisp that perform the Lengthen command from both side of Polyline by Digits Entry.
View 7 Replies View RelatedI found a lisp in the net to create a rectangle by marking objects in a draw.
But it would nice to get at the end of the lisp after creating the rectangle a output in the command line about the length and with of the created rectangle.
who can add the code for the length/width output?
(defun C:wer (/ AUSWAHL INDEX ELEM XYMIN XYMAX MINX MAXX MINY MAXY DATA A) (vl-load-com) (if(and(or (and (setq AUSWAHL (ssget "I")) (> (sslength AUSWAHL) 0)) (and (setq AUSWAHL (ssget)) (> (sslength AUSWAHL) 0)) ) (or(setq A (getreal "
Randabstand <0> : ")) (setq A 0.0) ) ) (progn (setq INDEX -1) (repeat
[code]........
How do I pause for a certain length of time 5 seconds or 10 seconds.
View 6 Replies View RelatedWhen we launch the list command, the Area system variable holds the area value of the selected shape.
How to get the length value into an Autolisp program to use it?
I have lisp code, which count total length, but I need that it count and multiply by constant which I choose manual (such as in example, total lines yellow length * y + total blue lines * x = ... , example 50*2 + 60 * 3=280),
remember the another code, such as I have d200 with total l=1000 and d250 with total l=1500, i need to count total cost such as 1000*y+1500*x
one think, diameters numbers is not only 1 or 2, it can be many different diameters.
dwg file here:
[URL]..........
lisp file here:
[URL]........
Several times, we generate a drawing, and the text widths in the columns vary greatly. Some have text that is ten characters long, and others have thirty-plus characters.
Is there a way to be able to select the table (or perform the command to all tables in the current layout) and have each of the columns expand to the appropriate width, that depends on the longest string of text in that column, for each column. The problem I see, is that some tables have two columns, some have six, and of course other with any number in between. The same is also true for the amount of rows.
I need a lisp file that can read the total length of selected object (lignes, polylines) and summarize them by layers or by color in a table
e.g
command:tl (total length)
select objects
found total length.......
select object (Ent)
total length or [Add/Subtract/Table] :
total length = .......
if table
Enter an option by [ Layer/Color/line Type/line Weight] <layer> :
lisp to count dynamic block including total length.
View 9 Replies View RelatedIs it possible to change the length of a line based on the length of an attribute?
I'd like to make the line a MINIMUM length of X" (I haven't decided how long yet--but know I'll need a minimum). But then after the user fills in the attribute, I'd like the length of the line to change to the length of the attribute plus a small amount (again, I haven't decided yet how much extra).
I've been looking for commant that will allow me to copy a selection of entities to another layer for details. I'll need to be able to select several objets all at once and have each of them maintain the correct colors, linetypes, lineweights. Most everything is set as bylayer but that makes everything change once the objects are moved to a new layer.
How can I keep the everything looking like it never changed except for the fact that it will be moved to a new layer - layer 0 in this situation?
Create a script or a lisp file to match a tif to a drawing file in autocad 2011?
View 9 Replies View RelatedThe crux of the matter is that the CANNOSCALE value needs to match an existing named scale. This lisp is part of a bigger lisp and I need to pass a variable into it. Here's what I have:
(setvar "CANNOSCALE" (strcat "1" = " (rtos variable 2 0) "'"))
But I get this error when I try to run it.
; error: bad argument type: numberp: nil
Normally when applying the matchprop command in CAD, one has to first pick the template element, and then select the elements which should have this template element's properties copied to/matched.
is it possible (via lisp perhaps?) to reverse this order, so that i can select a bunch of elements (e.g. through the quickselect icon) and THEN apply a matchpropertieslisp command, then select a single template element which the initially selected elements should mimic?
Trying to get the files I use which are single-layout tab files to name the layout tab to match the file name, minus the .DWG extension.
Here is what I am trying to use, but it doesn't seem to be working.
(DEFUN C:RRT (/ name)
(setq name (getvar (vl-filename-base (getvar "dwgname"))))
(command "-layout" "rename" name "")
(princ)
)
I was wondering if there is a way with DB's to have a line "follow" or "grow" with the content/value length of an attribute. Maybe some method of linking the attribute width to length of the line? Essentially, it would work just like turning on the underline setting when typing in mtext editor (or any program with an underline option for that matter), expect that the line could be placed anywhere, and would not have to reside directly below the text.
View 5 Replies View RelatedWith using superelevation wizard in Civil 3d 2012, changing the lane width is not affecting the resulted values of transion length and run-off length, Is that correct ? ( as civil is using standerd AASHTO tables which assume that lane width typically is 3.6m )
Also, There is only 2 tables for 2-lanes and 4-lanes roadway, Is it for total road width or for one directon only, and what about different no. of lanes ?
I am creating a block with attributes for a standard job. I have (4) total attributes in this block (for example: panel type, qty, length in imperial, length in mertic)
I would like my length in metric attribute to automatically populate based on the input from length in imperial.
Is this possible?
There are a ton of lisp to match text rotation to a selected line, but not vice versa.
View 9 Replies View RelatedI'm trying to plan an access road which must run at least 2.5m away from an existing fenceline. I've put a few parallel road lines in at 3m distance, but at the fence bends I decided to put some circles at the bend points to give me a 3m radius. When I did this I was suprised to find that the circle extends further than my access road. I've dimensioned them both up, CAD is telling me they're both 3m away but they're clearly not at the same distance.
View 9 Replies View RelatedI have used Autocad since 1991, and my current job required me to use Microstation. One feature I liked from Microstaiton is the ability to select and open an external DGN reference, and then match the view of the parent DGN. In AutoCAD, you can also select and open an xref, but the DWG opens to the previous saved view, and not to the desired view that matches the layout.
My thought was to experienting with lisp or scipt and export the "Viewctr", "Viewtwist" and "Viewsize" variables to a text file, then importing the text file and using the "Viewtwist" as my "SNAPANG" value, then "Viewctr" as my "ZOOM, CENTER" value, and finally the "Viewsize" as the "Enter magnification or height:" value.
But, alas, have no time, and not quite the knowledge to duplicate MicroStation's open-xref-and-zoom-to-view feature.