LISP add-on - need to assign sequential ID # to attributes

LISP add-on - need to assign sequential ID # to attributes

Anonymous
Not applicable
7,339 Views
58 Replies
Message 1 of 59

LISP add-on - need to assign sequential ID # to attributes

Anonymous
Not applicable

I have this awesome LISP from @dlanorh, and now need some new functionality added. Maybe the original creator can help me out? 🙂

 

In addition to what the LISP already does (calculating the sq ft and entering it in the attribute "Area ="), I would like to assign each polyline a unique ID # in one of the other attributes in that same block. The block is "RoomTagArea" and the attribute is "ID:". (Polylines and blocks are on the same layer.) The unique number would have the prefix "SM" followed by 6-digits starting at "000001". So the end result would look like "ID: SM000001", "ID: SM000002", "ID: SM000003", and so on for the blocks found within each polyline. Is this possible?

 

I've attached the original LISP and a screenshot of what the blocks should look like after running the LISP. Thanks!

0 Likes
Accepted solutions (3)
7,340 Views
58 Replies
Replies (58)
Message 41 of 59

Sea-Haven
Mentor
Mentor

There is dynamic door block floating around where the width is a parameter, this would seem to be the way to go, the dynamic block if I remember right has 4 visibilty states 2xleft 2xright for the in/out etc. Pretty sure it was posted here. The single line door would be say a 5th visibilty state. So using the "cp" pline hopefully will work.

0 Likes
Message 42 of 59

Becky_Sharp
Explorer
Explorer

Thanks for taking a look @Sea-Haven! So the catch here is that the floorplans I draw are uploaded into a software that converts the drawing to an svg for use on a website. Using blocks will not work because they never translate correctly when converted and end up rotating in random directions. I end up with doors in the walls, and toilets in the hallways, etc. The only blocks/connected segments allowed are the room tags and the closed polylines. All else is exploded and flattened to its simplest form before I upload. Additionally, some rooms have multiple doors, doors without door swings, sliding doors and cased openings. I knew this would be tricky considering those issues. 

0 Likes
Message 43 of 59

Becky_Sharp
Explorer
Explorer

Hi @dlanorh, Yes, the lisp works just as you remember! The finding of overlapping segments would be the best option for me. External doors aside, it will be the most accurate calculation of linear footage subtraction from the total. I work mostly with hospital floor plans and the sheer number of doors, different sizes, and types of doors is massive.  Overlapping segments where there is an opening is my best bet for catching the majority.

0 Likes
Message 44 of 59

Sea-Haven
Mentor
Mentor

"Make table with unlimited attributes per block but sorted and counted on up to the first 5 attributes. PM me to discuss.

 

Door1 22

Door2 Black 900 23

Door2 Black 1200 34

Door2 Silver Fire 900 23

Door2 Green Fire 900 15

Door3 Black 23

Doo23 green 12

and so on 

 

 

0 Likes
Message 45 of 59

Becky_Sharp
Explorer
Explorer

Hi Ron @dlanorh,

 

I hope you are well! Checking in to see if you've had any more thoughts about creating a lisp to calculate pline length, minus overlapped segments, or if it's possible at all? I'm thinking it may be better as a stand-alone lisp, rather than working it in to the previous version because recently when I added the pline length to the lisp, it caused the run time to increase by 10x at least. Thinking a separate lisp may be faster and more practical. I've been researching how to do this myself, but unfortunately my lisp skills are minimal at best. Also, if the lisp takes into account the stacked vertices, perhaps a "fuzz" tolerance can be worked in, in case the vertices don't line up perfectly, but are very close. Any help is always appreciated! Thank you!

 

Regards,

Becky

0 Likes
Message 46 of 59

dlanorh
Advisor
Advisor

Hi Becky,

sorry about the delay in replying but I have been working in a location away from internet access for the last week. I have no CAD with me, but will be returning home the first weekend in September. I have ideas to test, but I haven't used CAD/Lisp for over 8 months so it will be slow and laborious to start with.

 

 

 

 

 

 

I am not one of the robots you're looking for

Message 47 of 59

Sea-Haven
Mentor
Mentor

Removed.

 

Idea just fell apart the door is on same layer as a wall.

0 Likes
Message 48 of 59

Becky_Sharp
Explorer
Explorer
The doors and walls should be on different layers. Layer A-WALL for walls, and Floor_Plan_Features for everything else.
0 Likes
Message 49 of 59

Becky_Sharp
Explorer
Explorer

Hi Ron @dlanorh,

 

Checking in to see if you've had a chance to work on the lisp at all? If you don't have time, or feel a little too rusty as you said, is there another user in the forums you can recommend who may be able help me with this? I've only worked with you in the past, and have been so pleased with your lisp programs that I haven't reached out to anyone else.

 

Thanks again for all your help, current and past!

Becky Sharp

0 Likes
Message 50 of 59

Sea-Haven
Mentor
Mentor

Re remove door width the simplest way unfortunately would be just identify the room somehow then ask pick 2 points for door width and have answer, the other way is draw a line which is the door width, it would be under the room pline and on another layer a ssget "F" would find any doors touching that pline. The red lines are the door width on say a layer turned off. So only 2 in this sample need to add more as room has 5 doors.

 

SeaHaven_0-1632197255261.png

 

 

 

0 Likes
Message 51 of 59

Becky_Sharp
Explorer
Explorer

@Sea-Haven - Yes, that was an idea I considered, (going back into each room and drawing a line of a different layer over each opening), but I don't know how to write the code. Can you possibly write a sample lisp for your idea? Thanks!

0 Likes
Message 52 of 59

dlanorh
Advisor
Advisor

Hi Becky,

 

I have managed to get this working at small scale, but only with polylines where the segments are common. Working with a tolerance is producing erratic results. I have another idea to solve the issue but haven't had time to impliment and test it yet. It should work but requires that some (short) segments are not tested. Apologies that this is taking some time.

 

Ron

I am not one of the robots you're looking for

0 Likes
Message 53 of 59

Sea-Haven
Mentor
Mentor

I can see the nightmare where a room has 5 doors think of a central room, and that is 5 seperate rooms to be checked for a match segment, as you say if can solve that then answer is easy, I can see issues with CCW CW directions when comparing 2 plines may need to check twice so find the door in either direction. That may solve the tolerance problem as the common segment should be exact. A big project 100 rooms what a nightmare comparing plines. 

 

It may be worthwhile to Becky to think about overall approach from a starting point, draw a line across doorway as part of inserting the door a 2 step process but done as a single task. The line on a no plot layer.

0 Likes
Message 54 of 59

Becky_Sharp
Explorer
Explorer

Hi Ron,

No apologies needed! I am very grateful for any help you can offer. If the tolerance is causing erratic results, feel free to remove, unless a work-around can be found of course.

 

@Sea-Haven suggested a new process for adding a line of a different layer to the openings during the first phase of drawing the floorplans. That would be feasible going forward, but the floor plans needing this lisp are already complete with walls, doors, and polylines. This is a 22-story building with thousands of spaces. Going back in to add the lines would be far too time consuming.

 

Again, thank you! And I can't wait to see the lisp!

-Becky

0 Likes
Message 55 of 59

Sea-Haven
Mentor
Mentor

If the doors are a standard size say 2 or 3 sizes can check the pline for that distance and insert a line all done auto. Could add a secondary check that looks at next segment must be like 75mm I am metric, stops putting in on a short wall segment. Look at your dwg. Wall stud Distance = 0'-3 5/8" so say a check must be less than  than 9"

0 Likes
Message 56 of 59

Becky_Sharp
Explorer
Explorer

Hi Ron,

 

Would you be willing to send the lisp that is working, without the tolerance? It may work for what I'm doing. Let me know if this is a possibility.

 

Thanks,

Becky

0 Likes
Message 57 of 59

Sea-Haven
Mentor
Mentor

This is for dlanorh http://www.theswamp.org/index.php?topic=57072.0 maybe a way to find crossing plines.

Message 58 of 59

Becky_Sharp
Explorer
Explorer

Hi Ron @dlanorh,

 

Checking in to see if the lisp is going to work, or if you've had a chance to look at it anymore? If not, let me know so I can look into other options. Thank you again for all your help!

 

-Becky 

0 Likes
Message 59 of 59

Sea-Haven
Mentor
Mentor

Convert to svg are you using Inkscape ?

0 Likes