AutoCAD Visual LISP / AutoLISP :: Centerline Along Length Of 3D Solid Shape?
Dec 10, 2013
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
Any routine that would allow you to cut out an odd shape from a solid with the profile of a polyline?The goal would be to have all the pieces that are left, not subtract them out..
I want to create a custom linetype that uses a solid rectangle 0.5wide and 1.0 long. Basically I want to create a shape file from an existing block I have so that I can insert it into the linetype definition. Is there an easy way to do this in ACAD 2009?
I have double line pipe drawings but i have to change distances between of this lines in entire drawing and i was thinking that maybe there is a lisp code which can create new double line according to my specify dimensions ...
example :
Distance between lines : 100 mm
------------------------
------------------------
here is what i want to do :
1. select double line
2. specify new distance ( for example 200 mm)
3. lisp will create center line middle of the selected lines ( maybe it can ask me that this center line will be permanently or not )
4. lisp will create new double line from this centerline according to my specific distance
5. new double line layers will be the same with selected old double line
and this lisp has to work for double arc or quarter circles too.
We have this need to have all of the solids in a drawing to be placed in the "solid" layer.
Sometimes folks are drafting lines to develop these solids, and keeping the lines on the "solid" layer, rather than moving them to another layer, or deleting them altogether.
I could get folks to run this command before leaving the drawing.
I'm thinking something along the lines of:
Select all entities that are on the solids layer that are not solids.
If nil, great, do nothing.
If entities are selected, let me do something with them.
I'm hoping the following can be modified ever so slightly.
(setq non_solid (ssget "X" (list (cons 0 "3DSOLID")(cons 8 "solid"))))
I 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?
where 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!
My 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:
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 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]........
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.
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.
when I use the "_list" or "_massprop" command in AutoCad I can see the information in the attachment. when I use "(entget (entlast))" I can't see the values for the frame (Begrenzungsrahmen)
How can I get these values for the frame (Begrenzungsrahmen) in LISP?
I 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]....
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> :
know if there is a way to subtract one solid from another "with clearance" i.e. with an additional evenly applied clearance? I have seen this function in other applications, wondering if it possible somehow in Autocad?
I'm looking for a lisp routine which will 'convert' number of 2dsolid into hatch. Drawing contains dozens of 2dsolids (solids are on one layer, there are also other entities on this layer) which have different colors, have common verticies and edges. i.e. I want to kind of 'join' solids of the same color and convert them into one hatch colored as original solids and placed on existing layer (let it be layer '0' zero for now). Same color solids can exist in few locations - there is a case to make few separate hatches of the same color (all joined solids should be represented as 1 hatch, should not separate after separate hatch command). There is max of 20 different colors (all of them from ACI index). Solids are not crossing themself or other solids (just joining with 1 or 2 verticies).
There are also 2dsolids with 'zero-area' - represented as a line - those should be erased at the beginning (not to have a line-like hatch).
I am trying to do some minor animation with a shaded solid model. I have tried mslide and a script... this make s very jerky, flashing animation.
I tried a lisp routine to move the object in small increments, again the motion is very flashy and slow, as it appears to struggle perhaps with the shading.
I noticed doing a move command, and moving the same object manually, dragging the object around the screen with a mouse makes for pretty smooth motion. Way better than what I was doing.... Is there a way to do this programatically?