I need a lisp to get the total length (or area) of walls for different thickness of walls of 100mm, 150mm, 200mm and 300 thickness. Drawing is attached for the walls.
If there is a lisp which can do different hatch for different thickness areas, the result area can be obtained.
The result has to be:
Total length (or area) for 100mm thick wall=________m (or m2)
Total length (or area) for 150mm thick wall=________m (or m2)
Total length (or area) for 200mm thick wall=________m (or m2)
Total length (or area) for 300mm thick wall=________m (or m2)
Bonjour @sajid727
I propose you an example of drawing that will easily allow to make a listing of the different lengths and surfaces.
All wall types have an axis line, just measure it and multiply it by the value of the wall, and it’s done.
Do you need help to create this listing?
Amicalement
Is it possible to have a lisp so as to hatch areas of walls of same widths with same pattern and the walls of other widths with different pattern.
For example- all 200mm thickness walls as one pattern and so on for other walls.
well, that's depend on what CAD system you have, on AutoCAD for Architects if you use wall tool, you can get hatch and others properties, but if you only have AutoCAD vanila the walls you see on yours eyes, form AutoCAD eyes it only simples lines. you can achieve what you want only if you make it close plines.
Moshe
Bonjour @sajid727
Of course, it is possible, but, to avoid errors and make the programming easier, it is better to have a perfectly structured drawing.
The best solution is a serious management of layers.
We can do it without, but with it is much simpler and more precise.
Here is a new example of correct drawing.
Amicalement
The external walls in the image are 4 layers so could get a list of their lengths. Like others walls have been drawn on multi layers. You almost need non plot layers that are one side of the walls, these can be found and tallied, I can not see any quick way to work out length of a wall that is say 150 then go 90 degrees and is 300. I have some drag over functions that are used in the software that made image they set wall thickness for new walls. That would mean labelling every wall section manually. I think only way is to make a pline with width as was previously mentioned as make skinny rectangs, on a layer that you turn off. You need a draw walls function so the pline is made at same time as wall linework.
This works for some of the line work, just an idea. Note freeze the exploded hatch a problem.
(defun c:plinwall ( / pt1 pt2 pt3 pt4 mp dist)
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)
(while (setq pt1 (getpoint "\nPick pt1 "))
(setq pt2 (getpoint pt1 "\nPick pt1 2 "))
(setq pts (list pt1 pt2))
(setq ss (ssget "F" pts '((0 . "LINE"))))
(setq pt3 (vlax-curve-getclosestpointto (vlax-ename->vla-object (ssname ss 0)) pt1))
(setq pt4 (vlax-curve-getclosestpointto (vlax-ename->vla-object (ssname ss 1)) pt1))
(setq mp (mapcar '* (mapcar '+ pt4 pt3) '(0.5 0.5)))
(setq dist (distance pt3 pt4))
(setq d1 (distance pt1 pt3))
(setq d2 (distance pt1 pt4))
(if (> d1 d2)
(command "offset" (/ dist 2.0) (ssname ss 1) mp "")
(command "offset" (/ dist 2.0) (ssname ss 0) mp "")
)
(command "pedit" (entlast) "Y" "w" dist "")
)
(princ)
)
Did you turn off the hatching which is actually lines in your Wall.dwg. This will stuff up the selection.
Also note in some places you have 3 lines two yellow and a brown, you need to turn that layer off as well. Or pick carefully between the yellow and brown.
Bonjour @sajid727
I did not work for the drawing of axis lines.
I let you do it because you can do it. It’s your drawing, and you know the thicknesses, it’s very easy.
Of course, we can imagine a lisp, but we must not believe that programming is there for that, we program to do more complicated tasks than drawing by hand.
I started from the assumption that axis polylines exist and in the right layers
Here is the rendering of my program, tell me if it’s ok and I deliver you the program.
Amicalement.
"I started from the assumption that axis polylines exist and in the right layers"
@sajid727 I did not see in your dwg any Axis lines. So you need to draw those as part of the drawing walls procedure, the code suggested by @-didier- uses those lines. What I posted makes those lines with a pline width.
Looking at this image may be a way to make the center line, I have picked two wall edges so that I get a start and end length for all the wall may be more than 2 nibs. No code at moment.
What I previously posted sometimes would overlap walls. This idea may be better. Need some time.
Bonjour @sajid727
Sorry for the late, this holiday season keeps us away from computers, and that’s a good thing from time to time.
As I said, it is necessary that the axes exist (polylines), in layers with specific names, it is drawing “by hand”.
I have not made a code for this currently.
I wish you a good use and I will look at your comments to know how to react.
I give you a drawing example and the program.
Amicalement
Can't find what you're looking for? Ask the community or share your knowledge.