Hi,
First off I have little to no experience reading/editing a LISP. I'm trying to see if its possible to combine these two LISPS attached to get what I'm looking for. The AreaLabelV1-9.1 is a great lisp. Unfortunately, it doesn't account for duplicates to create a count # for picked areas or objects like the rectangle_dims LISP does. I need it to have the ability to consolidate duplicate areas so I don't have multiples in the table.
I'd appreciate any help/advice.![]()
-Me
Would it not be the 3 variables area, X and Y that are needed ?
If you just want areas no problems you make a list of all the areas and count up the same size ones, should be something out there now.
Area, X, Y, Label, and Count of each rectangle are needed. The AreaLabelV1-9.1 LISP captures all of these, but the count is linear and doesn't group together duplicates on the table. I'm wondering if there is a way to edit the LISP so it recognizes rectangles with the same X & Y and instead of labeling it a new #, it uses the # for that specific size then keeps the count going. So instead of 10 different rectangles, it would show 7 with duplicates. Thanks!
-Me
This was done for someone else I think its what you want. Please post a dwg problem is the code was coded for stuff like layer names. It does more like numbers the rectangs so a size 2 would appear in the results table as say 2,4 see image.
Hi!
That image you posted is close to what I am looking for except for the layer names. I attached a DWG showing an example of what I'd use it for. A LISP able to label each rectangle and still keep an accurate count for the duplicates in the table. The rectangle dims.lsp attached doesn't label the rectangles chosen.
Thanks!!
It has been a while since I looked at this, your welcome to play with the code. Your dwg needs a different way of approaching counting the labels and getting their size, maybe a list manipulation. Just get the label text use bpoly to get area and make a list of (label area)
((2 area 2)(3 area3)(2 area2) ...... becomes (2 area2 2)(3 area3 1) I am not very good at mapcar lists.
So basically, what my end goal is you can see in the dwg attached below. I have a main poly line (shown in global weight black), and I need to get its area by manual calculation. For that, I make smaller rectangles inside a main rectangle. So, by deducting smaller rectangle from the main one, you will get the net area of the main poly line.
What I want is, by selecting all the smaller rectangle, the lisp would auto place dimensions and name them accordingly with rectangles of similar LxB as one entry in table and not as duplicates. The same would be placed in a table as shown in drawing.
Added to my to do list. Have like 5 at moment.
Can see a way to do but need a couple of changes to dwg will explain later.
Sorry dropped off my list may have some time this week to see if can do something.
Update 13/11/2022 all rectangs are now numbered and sizes grouped, but I have been busy doing other stuff. Will get back to it.
Update 15/11 rects labelled and dims version 1. Need to look at consistency in dims, later version, next is table.
Update 17/11 dims now left side and top only, full table created all items, next step is to get count working properly.
I have realised need to probably rewrite a fair bit of it so it takes into account len & wid & area being totaled properly, so have posted where I am up to. It needs to use a different algorithm that I have to do the counting part, and the table needs some customisation to the cells text and sizes etc. Sometimes just have to take a big step back and do again.
see new version below
I have posted to show the complexity of such a request.
After a bit more work try this, note there are some thick plines which I turned off not sure if they are to be included kept the obvious rectang ones.
See latest post for updated code.
Hey, for some reason the lisp isnt working in my CAD. Whenever I select the rectangles, the table gets generated but its black. Could you generate an excel for the same?
No, what messages appear, just saying does not work means nothing. Is there anything in the table as current table style can affect the result. Post dwg with result.
Hey, the table is being generated, however the main rectangle through which we have to subtract the smaller ones is not being input in the table. Also, if you see in the drawing, 2 and 3 are numbered differently but they are of same size. Also in the table, the main subtraction is not input (see last few rows of my older table). I think its better if we export it to excel, I will have more flexibility to change stuff as needed. Also, Is there any way to number these rectangles clockwise or so?
Also, Is there any way to number these rectangles clockwise or so? Not for free, a bit of work as rectangs are sorted based on area to find equals so no check for actual location. Thats like a renumber blocks but also table still match.
It has missed a couple will go back and have another look it should do 20 and 21.
Can't find what you're looking for? Ask the community or share your knowledge.