Jump to content
Clifford169

Advice on a simple door tool

Recommended Posts

Clifford169

Okay, so I know there are plenty of door tools out there, but none of them have so far done what I've wanted or look how I want them to.

 

I need something that will allow me to choose a door opening, either by line selecting or choosing two points, and then decide the door swing and side of the line.

Also, I need the lines to be essentially a quarter circle with a polyline drawn out to the quadrant. Simple single lines is all I need.

 

Closest I got to this was creating a block and having it copy in to the base line and then pressing [tab] to change the swing and side. This was however buggy and created a load of blocks that I don't really want.

 

Anyone heard of a lisp that will do this, or can assist me in creating one?

Share this post


Link to post
Share on other sites
Clifford169

Bit of a post bump, but to update what I've found so far:

 

Some people have approached this with similar tools, but they show the door itself as a thickness. I can never get these to work how I'd like them to - often they don't load.

The LISP I found that would do what I wanted but with a block started to bug and would stop working at random intervals, so isn't a workable solution.

 

Would love some advice on this so I can tick it off my January to do list!

Share this post


Link to post
Share on other sites
ReMark

A dynamic block won't work for your situation?

Share this post


Link to post
Share on other sites
Clifford169

I'm not very well versed in dynamic blocks. I've had a search and found a guide but looks like it may not give me the solution I'm after.

 

I'll give it a try and update the post with my findings ^.^

Share this post


Link to post
Share on other sites
ReMark

Maybe I am missing something here. You basically want to insert a block comprised of a single line (for the door) and an arc (for the door swing). You want to insert this into an opening in your wall then change the orientation of the door depending upon your needs. What else have I overlooked? Are the doors of varying widths?

Share this post


Link to post
Share on other sites
Clifford169
Maybe I am missing something here. You basically want to insert a block comprised of a single line (for the door) and an arc (for the door swing). You want to insert this into an opening in your wall then change the orientation of the door depending upon your needs. What else have I overlooked? Are the doors of varying widths?

 

We do measured surveys of varying properties across the country and the doors are rarely the same width.

 

Currently, we will draw our door opening in the wall, then draw a circle from the door jam across the opening and then a polyline out to the quadrant perpendicular to the door jam before trimming out the extra 3/4 of the circle. Then, if not already, we'll change it into our 'door' layer.

 

Eg:

Capture.PNG?dl=0

 

Ideally, I want it to not be a block, but draw the door as shown already in our 'door' layer with a few simple clicks.

Share this post


Link to post
Share on other sites
ReMark

Basically as I described it. So you want a lisp routine that will draw a door and the swing arc based upon an opening who's size is variable and not fixed. And it can't be a block.

Share this post


Link to post
Share on other sites
Clifford169
Basically as I described it. So you want a lisp routine that will draw a door and the swing arc based upon an opening who's size is variable and not fixed. And it can't be a block.

 

Exactly, yea ^^ We recently did a college accommodation block with some 200+ doors in it. Although it is not directly my job, I'm trying to explore every avenue to improve and speed up our office drawing process.

Share this post


Link to post
Share on other sites
steven-g

Just killing time until a LISPER comes along, this does use a block to start with, but explodes it in there somewhere, it requires 3 clicks for each door.

1)hinge point

2)width - so other side of the opening

3)will depend on if the swing needs flipping if yes click the end of the door leaf to flip the swing - or if it's correct click for the third point click back on the hinge point and the door won't flip.

It works from a macro which you could place on a toolpalette or menu or riibbon and runs repeatedly untill you hit escape. I live in the metric side of the world so if you use those funny measurements it will need adapting. Anyway take a look at the attached drawing which contains the starting block and a 7 sided wall to practice on, the block has an alignment parameter so when you pick the first point (hinge) the side of the wall you approach the pick point from will determine which side of the wall the door is placed, that's why you get the practice wall :D.

And here is the macro that places the doors.

*^C^C^C._insert;Door;end;\;;;_scale;last;;$M=$(getvar,lastpoint);reference;1000;\explode;last;_mirror;last;;$(index,0,$(getvar,lastpoint)),$(index,1,$(getvar,lastpoint));\y;

Door.dwg

Share this post


Link to post
Share on other sites
BKT

Here's one to try until something better comes along. Not elegant, not error trapped, but seems to work as you indicated.

 

(defun c:door (/ len ln1 pt1 pt2 pt3 pt4 pt5)

(setq pt1 (getpoint "\nSelect Hinge Point: ")
     pt2 (getpoint "\nSelect Jam Point: ")
     len (distance pt1 pt2)
     pt4 (polar pt1 (+ (angle pt1 pt2) (/ pi 2)) len)
     pt5 (polar pt1 (- (angle pt1 pt2) (/ pi 2)) len)
)

(command "._LINE" pt4 pt5 "")

(setq ln1 (entlast))

(setq pt3 (getpoint "\nPick End Of Line On Swing Side: "))

(if
 (equal pt3 pt4 0.000001)
   (command "._ARC" pt2 "_C" pt1 pt3)
   (command "._ARC" pt3 "_C" pt1 pt2)
)

(command "._PLINE" pt1 pt3 "")

(entdel ln1)

(princ)
)

Share this post


Link to post
Share on other sites
tzframpton

I'm curious as to why it cannot be a block?

Share this post


Link to post
Share on other sites
David Bethel

This is cobbled together from some exiting routines:

 

  • Fire rated commercial door frame
  • 2" Door panel
  • Minimum 4" wall thickness

 

It ain't pretty, but a lot of it was written in the 1990s

 

[b][color=BLACK]([/color][/b]defun c:door2d [b][color=FUCHSIA]([/color][/b]/ h f hf dd d s o w ll bn hp i a[b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]initget 1 [color=#2f4f4f]"Right Left"[/color][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setq h [b][color=NAVY]([/color][/b]getkword [color=#2f4f4f]"\nDoor Hinging - Right/Left:   "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]initget 6[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setq f [b][color=NAVY]([/color][/b]getdist [color=#2f4f4f]"\nOverall Frame Width <40>:   "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]or f [b][color=NAVY]([/color][/b]setq f 40[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setq hf [b][color=NAVY]([/color][/b]* f 0.5[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]setq dd [b][color=NAVY]([/color][/b]- f 4[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]initget 6[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setq d [b][color=NAVY]([/color][/b]getdist [b][color=MAROON]([/color][/b]strcat [color=#2f4f4f]"\nDoor Panel Width <"[/color] [b][color=GREEN]([/color][/b]rtos dd 2 2[b][color=GREEN])[/color][/b] [color=#2f4f4f]">:   "[/color][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]or d [b][color=NAVY]([/color][/b]setq d dd[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setq s [b][color=NAVY]([/color][/b]* [b][color=MAROON]([/color][/b]- f d[b][color=MAROON])[/color][/b] 0.5[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]or [b][color=MAROON]([/color][/b]not o[b][color=MAROON])[/color][/b]
            [b][color=MAROON]([/color][/b]> o [b][color=GREEN]([/color][/b]* pi [b][color=BLUE]([/color][/b]/ 170.01 180[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b]
            [b][color=GREEN]([/color][/b]< o [b][color=BLUE]([/color][/b]/ pi 6[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
        [b][color=NAVY]([/color][/b]initget 5[b][color=NAVY])[/color][/b]
        [b][color=NAVY]([/color][/b]setq o [b][color=MAROON]([/color][/b]getangle [color=#2f4f4f]"\nOpen Angle Min 30 Max 170 <90>:   "[/color][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
        [b][color=NAVY]([/color][/b]or o [b][color=MAROON]([/color][/b]setq o [b][color=GREEN]([/color][/b]* pi 0.5[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]or [b][color=MAROON]([/color][/b]not w[b][color=MAROON])[/color][/b]
            [b][color=MAROON]([/color][/b]< w 4[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
        [b][color=NAVY]([/color][/b]initget 6[b][color=NAVY])[/color][/b]
        [b][color=NAVY]([/color][/b]setq w [b][color=MAROON]([/color][/b]getdist [color=#2f4f4f]"\nWall Thickness - Min 4 <6>:   "[/color][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
        [b][color=NAVY]([/color][/b]or w [b][color=MAROON]([/color][/b]setq w 6[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]defun makel [b][color=NAVY]([/color][/b]p1 p2[b][color=NAVY])[/color][/b]
    [b][color=NAVY]([/color][/b]entmake [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]cons 0 [color=#2f4f4f]"LINE"[/color][b][color=GREEN])[/color][/b]
                   [b][color=GREEN]([/color][/b]cons 8 [color=#2f4f4f]"2D-DOOR"[/color][b][color=GREEN])[/color][/b]
                   [b][color=GREEN]([/color][/b]cons 6 [color=#2f4f4f]"BYLAYER"[/color][b][color=GREEN])[/color][/b]
                   [b][color=GREEN]([/color][/b]cons 39 0[b][color=GREEN])[/color][/b]
                   [b][color=GREEN]([/color][/b]cons 62 256[b][color=GREEN])[/color][/b]
                   [b][color=GREEN]([/color][/b]cons 10 p1[b][color=GREEN])[/color][/b]
                   [b][color=GREEN]([/color][/b]cons 11 p2[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]setq ll [b][color=NAVY]([/color][/b]list
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- hf[b][color=BLUE])[/color][/b] 0 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- hf[b][color=BLUE])[/color][/b] 0.5 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ hf[b][color=BLUE])[/color][/b] 0 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ hf[b][color=BLUE])[/color][/b] 0.5 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]

          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] 0[b][color=BLUE])[/color][/b] 0.5 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s[b][color=BLUE])[/color][/b] 0.5 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] 0[b][color=BLUE])[/color][/b] 0.5 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s[b][color=BLUE])[/color][/b] 0.5 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]

          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s[b][color=BLUE])[/color][/b]  0.5 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s[b][color=BLUE])[/color][/b] -1.5 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s[b][color=BLUE])[/color][/b]  0.5 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s[b][color=BLUE])[/color][/b] -1.5 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]

          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s 0.0[b][color=BLUE])[/color][/b] -1.5 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s 0.5[b][color=BLUE])[/color][/b] -1.5 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s 0.0[b][color=BLUE])[/color][/b] -1.5 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s 0.5[b][color=BLUE])[/color][/b] -1.5 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]

          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s 0.5[b][color=BLUE])[/color][/b] -1.5 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s 0.5[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 1.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s 0.5[b][color=BLUE])[/color][/b] -1.5 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s 0.5[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 1.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]

          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s 0.0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 0.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s 0.0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 1.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s 0.0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 0.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s 0.0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 1.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]

          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s 0.5[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 1.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s 0.0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 1.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s 0.5[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 1.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s 0.0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 1.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]

          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- hf[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- w[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- hf[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 0.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ hf[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- w[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ hf[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 0.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]

          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] 0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 0.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]+ [b][color=RED]([/color][/b]- hf[b][color=RED])[/color][/b] s[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 0.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
          [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] 0[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 0.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b]
                [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]+ hf[b][color=RED])[/color][/b] s[b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]- [b][color=RED]([/color][/b]- w[b][color=RED])[/color][/b] 0.5[b][color=BLUE])[/color][/b] 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
                [b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]entmake [b][color=NAVY]([/color][/b]list [b][color=MAROON]([/color][/b]cons 0 [color=#2f4f4f]"BLOCK"[/color][b][color=MAROON])[/color][/b][b][color=MAROON]([/color][/b]cons 2 [color=#2f4f4f]"*U"[/color][b][color=MAROON])[/color][/b][b][color=MAROON]([/color][/b]cons 70 1[b][color=MAROON])[/color][/b][b][color=MAROON]([/color][/b]list 10 0 0 0[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]= h [color=#2f4f4f]"Right"[/color][b][color=NAVY])[/color][/b]
      [b][color=NAVY]([/color][/b]setq hp [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]+ [b][color=BLUE]([/color][/b]- hf[b][color=BLUE])[/color][/b] s[b][color=GREEN])[/color][/b] 0.5 0[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
      [b][color=NAVY]([/color][/b]entmake [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]cons 0 [color=#2f4f4f]"LINE"[/color][b][color=GREEN])[/color][/b]
                     [b][color=GREEN]([/color][/b]cons 8 [color=#2f4f4f]"2D-DOOR"[/color][b][color=GREEN])[/color][/b]
                     [b][color=GREEN]([/color][/b]cons 10 hp[b][color=GREEN])[/color][/b]
                     [b][color=GREEN]([/color][/b]cons 11 [b][color=BLUE]([/color][/b]polar hp o d[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
       [b][color=NAVY]([/color][/b]entmake [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]cons 0 [color=#2f4f4f]"ARC"[/color][b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 8 [color=#2f4f4f]"2D-DOOR"[/color][b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 10 hp[b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 40 d[b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 50 0[b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 51 o[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]= h [color=#2f4f4f]"Left"[/color][b][color=NAVY])[/color][/b]
      [b][color=NAVY]([/color][/b]setq hp [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]- [b][color=BLUE]([/color][/b]+ hf[b][color=BLUE])[/color][/b] s[b][color=GREEN])[/color][/b] 0.5 0[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
      [b][color=NAVY]([/color][/b]entmake [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]cons 0 [color=#2f4f4f]"LINE"[/color][b][color=GREEN])[/color][/b]
                     [b][color=GREEN]([/color][/b]cons 8 [color=#2f4f4f]"2D-DOOR"[/color][b][color=GREEN])[/color][/b]
                     [b][color=GREEN]([/color][/b]cons 10 hp[b][color=GREEN])[/color][/b]
                     [b][color=GREEN]([/color][/b]cons 11 [b][color=BLUE]([/color][/b]polar hp [b][color=RED]([/color][/b]- pi o[b][color=RED])[/color][/b] d[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
       [b][color=NAVY]([/color][/b]entmake [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]cons 0 [color=#2f4f4f]"ARC"[/color][b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 8 [color=#2f4f4f]"2D-DOOR"[/color][b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 10 hp[b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 40 d[b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 50 [b][color=BLUE]([/color][/b]- pi o[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b]
                      [b][color=GREEN]([/color][/b]cons 51 pi[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]
 
 [b][color=FUCHSIA]([/color][/b]foreach l ll
      [b][color=NAVY]([/color][/b]makel [b][color=MAROON]([/color][/b]car l[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]cadr l[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]setq bn [b][color=NAVY]([/color][/b]entmake [b][color=MAROON]([/color][/b]list [b][color=GREEN]([/color][/b]cons 0 [color=#2f4f4f]"ENDBLK"[/color][b][color=GREEN])[/color][/b][b][color=GREEN]([/color][/b]cons 8 [color=#2f4f4f]"0"[/color][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]initget 1[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setq i [b][color=NAVY]([/color][/b]getpoint [color=#2f4f4f]"\nINSERT Point:   "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]initget 1[b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b]setq a [b][color=NAVY]([/color][/b]getangle i [color=#2f4f4f]"\nINSERT Angle:   "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]entmake [b][color=NAVY]([/color][/b]list [b][color=MAROON]([/color][/b]cons 0 [color=#2f4f4f]"INSERT"[/color][b][color=MAROON])[/color][/b][b][color=MAROON]([/color][/b]cons 2 bn[b][color=MAROON])[/color][/b][b][color=MAROON]([/color][/b]cons 10 i[b][color=MAROON])[/color][/b][b][color=MAROON]([/color][/b]cons 50 a[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b]

 [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b]

 

 

-David

Share this post


Link to post
Share on other sites
ReMark

I'm pretty sure, according to the OP, there only needs to be two objects drawn. 1) A single line representing the door and 2) the 90 deg arc that represents the door swing. Anything else is superfluous.

Share this post


Link to post
Share on other sites
David Bethel
I'm pretty sure, according to the OP, there only needs to be two objects drawn. 1) A single line representing the door and 2) the 90 deg arc that represents the door swing. Anything else is superfluous.

 

 

It's easy to take the door frame lines out. We'll have to wait and see.

Share this post


Link to post
Share on other sites
jweber

I thought this would be an easy one, but got stumped at creating an arc with entmake, and having it go 270 degrees rather than 90 half the time. I know why it's doing it, but cant seem to get around it. Hoping someone could pick up where I left off :)

(defun c:door ()
 (initget 1)
 (setq pt1 (getpoint "\nInsertion Point:   ")
       pt2 (getpoint "\nDoor Width:     ")
       an1 (getangle pt1 "\nSwing Direction:   ")
       an2 (angle pt1 pt2)
       dis (distance pt1 pt2)
       pt3 (polar pt1 an1 dis))     
;  (cond ((<= an2 (- an1 pi))
;        (setq temp (list an1 an2)
;              an1 (cadr temp)
;              an2 (car temp))
;        )
;  )
 (command "line" pt1 pt3 "")
 (entmake (list (cons 0 "ARC")
     	 (cons 10 pt1)
     	 (cons 40 dis)
     	 (cons 50 an2)
     	 (cons 51 an1)))
 (princ))

Share this post


Link to post
Share on other sites
David Bethel

ARC groups 50 and 51 are always CCW, 50 being the start angle, 51 the end angle

 

I would ask for door hinge direction as a parameter, then you can calculate the angles

Share this post


Link to post
Share on other sites
Grrr

I would go with David's suggestion - Using Blocks and not linework that can complicate and overflow the drawing.

The further advantage would be easy schleduling any blocks that represent doors / windows, and easy modification - if you need to move any door or window.

In the end you can always explode and purge them.

 

One thing I would change in David's code is to use acronyms for the block's names, like:

R_FW40_PW36_A45_WT6 - Which would mean Right, FrameWidth = 40, Panel Width = 36, Angle = 45, Wall Thickness = 6.

Then a check like this could be used (atleast he might get the idea):

[b][color=BLACK]([/color][/b]cond
 [b][color=FUCHSIA]([/color][/b] [b][color=NAVY]([/color][/b]not [b][color=MAROON]([/color][/b]or [b][color=GREEN]([/color][/b]getstring t [color=#2f4f4f]"\nSpecify block name to insert: "[/color][b][color=GREEN])[/color][/b]
   [b][color=GREEN]([/color][/b]and [b][color=BLUE]([/color][/b]setq h [b][color=RED]([/color][/b]getkword [color=#2f4f4f]"\nDoor Hinging - Right/Left:   "[/color][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b]
     [b][color=BLUE]([/color][/b]setq f [b][color=RED]([/color][/b]getdist [color=#2f4f4f]"\nOverall Frame Width <40>:   "[/color][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b]
     [b][color=BLUE]([/color][/b]setq d [b][color=RED]([/color][/b]getdist [b][color=PURPLE]([/color][/b]strcat [color=#2f4f4f]"\nDoor Panel Width <"[/color] [b][color=TEAL]([/color][/b]rtos dd 2 2[b][color=TEAL])[/color][/b] [color=#2f4f4f]">:   "[/color][b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b]
     [b][color=BLUE]([/color][/b]setq o [b][color=RED]([/color][/b]getangle [color=#2f4f4f]"\nOpen Angle Min 30 Max 170 <90>:   "[/color][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b]
     [b][color=BLUE]([/color][/b]setq w [b][color=RED]([/color][/b]getdist [color=#2f4f4f]"\nWall Thickness - Min 4 <6>:   "[/color][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b]
   [b][color=GREEN])[/color][/b] [b][color=MAROON])[/color][/b] [b][color=NAVY])[/color][/b]
   [b][color=NAVY]([/color][/b]princ [color=#2f4f4f]"\nNothing specified"[/color][b][color=NAVY])[/color][/b]
 [b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b] [b][color=NAVY]([/color][/b]tblsearch [color=#2f4f4f]"BLOCK"[/color] [color=#2f4f4f]"R_FW40_PW36_A45_WT6"[/color][b][color=NAVY])[/color][/b]
   [b][color=NAVY]([/color][/b]if [b][color=MAROON]([/color][/b]setq p [b][color=GREEN]([/color][/b]getpoint [color=#2f4f4f]"\nInsertion point: "[/color][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b]
   [b][color=MAROON]([/color][/b]SubFunToInsBlk p[b][color=MAROON])[/color][/b] [b][color=NAVY])[/color][/b]
 [b][color=FUCHSIA])[/color][/b]
 [b][color=FUCHSIA]([/color][/b] [b][color=NAVY]([/color][/b]setq p [b][color=MAROON]([/color][/b]getpoint [color=#2f4f4f]"\nInsertion point: "[/color][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b]
   [b][color=NAVY]([/color][/b]SubFunToCreateBlk [color=#2f4f4f]"R_FW40_PW36_A45_WT6"[/color][b][color=NAVY])[/color][/b]
   [b][color=NAVY]([/color][/b]SubFunToInsBlk p[b][color=NAVY])[/color][/b]
 [b][color=FUCHSIA])[/color][/b]
[b][color=BLACK])[/color][/b]

 

It ain't pretty, but a lot of it was written in the 1990s

IMO thats very impressive!

Share this post


Link to post
Share on other sites
BIGAL

I like the door jambs David, it was the next thing to do to "Cadarc" its like your program started life 1990's

3dhouse.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...