### Author Topic: What parameters would I need to accomplish this?  (Read 5657 times)

0 Members and 1 Guest are viewing this topic.

#### daron

• Guest
##### What parameters would I need to accomplish this?
« on: February 24, 2005, 11:16:48 AM »
The image below shows selected lines. Currently, I need to select lines like this in order to get a true linear feet of the length of the wall. (I work in concrete now. Everything is one wall, no separations.) Anywhoo,What I want to do is select everything and mathematically figure the true length of the wall.

#### daron

• Guest
##### What parameters would I need to accomplish this?
« Reply #1 on: February 24, 2005, 11:33:11 AM »
I just figured something out. The above image doesn't portray the complexity of what I need. As is, a simple polyline of each side's lengths added together and divided by two (IOW the average) would give me what I want, but the task at hand is more complex.
A) plines can't be used. As I said in the last post, all is as one wall, but there can be varying heights and widths. We designate colors to clarify our intentions and I need to separate the info for each color.

Man, I wish we had ADT here.

• Guest
##### What parameters would I need to accomplish this?
« Reply #2 on: February 24, 2005, 12:15:10 PM »
Area divided by wall thickness would be length of wall, wouldn't it?

Get the area between the lines, maybe using HPBOUND=0, BOUNDARY, and AREA and divid by wall thickness?

#### CAB

• Global Moderator
• Seagull
• Posts: 10401
##### What parameters would I need to accomplish this?
« Reply #3 on: February 24, 2005, 12:46:00 PM »
Well before you added "Varying Widths" in there all you had to do is get the length of the centerline of the wall.
You are saying that the one wall can vary in width? And that is indicated by color?
Is each wall type a pline or are all lines?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

#### daron

• Guest
##### What parameters would I need to accomplish this?
« Reply #4 on: February 24, 2005, 12:56:18 PM »
Well Randy, that works, but I can't convert or create plines with any effectiveness. Here is a more complex image to what I'm getting at. Sorry for not bringing out enough info. I was trying to keep it simple, but it doesn't seem like that will happen. You can see with this, that certain lengths need to be drawn out based on their color and can even be separated at times.

• Guest
##### What parameters would I need to accomplish this?
« Reply #5 on: February 24, 2005, 02:30:42 PM »
Quote from: Daron
Well Randy, that works, but I can't convert or create plines with any effectiveness. Here is a more complex image to what I'm getting at. Sorry for not bringing out enough info. I was trying to keep it simple, but it doesn't seem like that will happen. You can see with this, that certain lengths need to be drawn out based on their color and can even be separated at times.

hmmm... the BOUNDARY command, with HPBOUND set to 0 will create a new REGION in the wall area.  The area of the REGION divided by the wall thickness should be the length of wall.  So I see a routine that actually builds the REGION with BOUNDARY using an internal point selection, gets it's area, does the math, then deletes the REGION.  But I'm guessing.

#### daron

• Guest
##### What parameters would I need to accomplish this?
« Reply #6 on: February 24, 2005, 02:43:20 PM »
You would be correct in your guess, but I want to be able to select all lines of a specific type. Example: the image above, you have basement colored cyan for 9'x10" wall, red for 5'x10" wall, white for 7'x10" wall, magenta for 9'x12" wall, garage wall: green for 4'x8" wall and blue for 4'x10" wall. Now, selecting only basement colors, I need to separate each color into separate lengths. Yes, this negates my comments in the initial post about a single wall. Sometimes it's easier to get down what you mean after throwing it against the wall a few times. BTW, does this make more sense at what I'm getting at and why the pline idea won't work.

#### CAB

• Global Moderator
• Seagull
• Posts: 10401
##### What parameters would I need to accomplish this?
« Reply #7 on: February 24, 2005, 03:44:53 PM »
Pseudo code:
-----------
User input: Select line color, pick a line, <red> picked
User input: Select lines to process or press enter for all lines of color <red>
ssget filtered for LINES & Color <red>
> verify even number of lines
> add the lengths  and divide by 2 eq wall length
> report results
done
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

#### daron

• Guest
##### What parameters would I need to accomplish this?
« Reply #8 on: February 25, 2005, 09:37:41 AM »
Okay, let's see if I can do this.

> Select all lines on wall layer.
> Separate all lines by color.
> Get true length of each color grouping

The last one is the one I want. I could make the user select lines individually like in the first image, but I'd like to find a way without that much user input.

• Guest
##### What parameters would I need to accomplish this?
« Reply #9 on: February 25, 2005, 10:41:09 AM »
Quote from: Daron
You would be correct in your guess, but I want to be able to select all lines of a specific type. Example: the image above, you have basement colored cyan for 9'x10" wall, red for 5'x10" wall, white for 7'x10" wall, magenta for 9'x12" wall, garage wall: green for 4'x8" wall and blue for 4'x10" wall. Now, selecting only basement colors, I need to separate each color into separate lengths.
ahhh, okay, well that just fried my puny skills

Quote from: Daron
Sometimes it's easier to get down what you mean after throwing it against the wall a few times.
knocks off the extraneous dingle-berries.

Quote from: Daron
BTW, does this make more sense at what I'm getting at and why the pline idea won't work.
Yeah, I can see what you need now, it's just beyond my meager abilities

#### DEVITG

• Bull Frog
• Posts: 479
##### What parameters would I need to accomplish this?
« Reply #10 on: February 25, 2005, 11:59:06 AM »
Hi Daron , could you upload the dwg on the lilly pound ??

Just to work with your's onw lines and colors.

Sure it will be more easy to handle.

Or send it to

devitg@gmail.com
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

#### CAB

• Global Moderator
• Seagull
• Posts: 10401
##### What parameters would I need to accomplish this?
« Reply #11 on: February 25, 2005, 01:04:46 PM »
Daron,
The "WALL" layer, is it one layer named WALL with the color set or is it several layers with differant names.If you select the wall layer are you going to get anything besides LINES?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

#### DEVITG

• Bull Frog
• Posts: 479
##### All this queistions , have a simple answer: the DWG you use.
« Reply #12 on: February 25, 2005, 01:20:43 PM »
Quote from: CAB
Daron,
The "WALL" layer, is it one layer named WALL with the color set or is it several layers with differant names.If you select the wall layer are you going to get anything besides LINES?

Seem to be some of us are afraid to show on a *.dwg what we are doing.

I think that to work with the *.dwg where the lisp will be applied , is a easy way to help you .
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

#### CAB

• Global Moderator
• Seagull
• Posts: 10401
##### What parameters would I need to accomplish this?
« Reply #13 on: February 25, 2005, 02:07:50 PM »
This is what I had in mind Daron.
This gives you the center line length of each wall type.
By using the centerline there is some averaging when two wall types meet.
The lines form a 45 degree intersection but in reality there has to be a squaring off and
only one wall type will own the corner.
Code: [Select]
`;;  3 green     4'x8" ;;  5 blue      4'x10" ;;  1 red       5'x10";;  7 white     7'x10";;  4 cyan      9'x10";;  magenta   9'x12"(defun c:get_wl (/ getl 4X10 4X8 5X10 7X10 9X10 9X12)  (defun getl (ss / en el tl)    (and ss         (setq tl 0)         (repeat (sslength ss)           (setq el (entget (setq en (ssname ss 0))))           (setq tl                  (+ tl                     (distance (cdr (assoc 10 el)) (cdr (assoc 11 el)))))           (ssdel en ss)         )    )    (cond      (tl       (/ tl 2))    )  )  (setq 4x8 (getl (ssget "_X" '((0 . "LINE") (8 . "Wall") (62 . 3)))))  (setq 4x10 (getl (ssget "_X" '((0 . "LINE") (8 . "Wall") (62 . 5)))))  (setq 5x10 (getl (ssget "_X" '((0 . "LINE") (8 . "Wall") (62 . 1)))))  (setq 9x10 (getl (ssget "_X" '((0 . "LINE") (8 . "Wall") (62 . 4)))))  (setq 9x12 (getl (ssget "_X" '((0 . "LINE") (8 . "Wall") (62 . 6)))))  (setq 7x10 (getl (ssget "_X"                    '((0 . "LINE")                      (8 . "Wall")                      (-4 . "<OR")                      (62 . 7)                      (62 . 256)                      (-4 . "OR>")                     )             )  ))   (princ)) ; end defun`
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

#### daron

• Guest
##### What parameters would I need to accomplish this?
« Reply #14 on: February 25, 2005, 02:22:05 PM »
CAB, there is one layer called "walls". We merely change the colors to designate different widths and heights. I've got some code that will separate all lengths by their color and apply the addition of the lengths of the colors to specified variables. Variable names are this wall-length-1 through wall-length-9. Anything after that and you are left with a message telling you to try again. All I need is some possible equation on how to take the length lines and find a true length.

DevitG, I don't see how dropping a drawing file will do anything. Take three lines in a non-closed box, offset them, clean them up and try to programmatically get the length of the center-line of the walls. No snap-points, no user interaction, except ssget.