CB_
These are some simple task that i repeat OVER & OVER & OVER & OVER.
Well you get the picture.. The routines are very simple and easy to write.
Start simple & build up. Here are some i started with.
(a note here, having started with these I have not gone back to make them correct
or fancier. If it aint broke i don't have time to fix it
Here is one i use a lot, pick a point for SNAPBASE then start the HATCH command.
It is useful for placing a tile hatch just so, or a barrel tile hatch so it is aligned.
It has many uses..
^C^CSNAPBASE;\(while (progn (initdia) (command "BHATCH" pause)));
Here is another I use to hatch hip roof with tile hatch.
The 10" wide hatch looks better offset 5" from the peak so by selecting the peak the
routine offsets SNAPBASE by 5" then hatches the area below.
(defun C:rft(/ usercmd useros pt)
(setq usercmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setq useros (getvar "osmode"))
(setvar "osmode" 137)
(Setq pt (getpoint "Pick Center point of hatch"))
(if pt
(progn
(setvar "osmode" 0)
(command "snapbase" (polar pt 0 5))
(command "-BHATCH" "_P" "_USER" "90" "10" "N" (polar pt 4.7 5) "")
))
(setvar "osmode" useros)
(setvar "CMDECHO" usercmd)
(princ)
) ;_end of defun
Here is one I use to trace an object the pick a side to offset to then enter the distance.
Creates a polyline offset. This is good for many tasks.
I use it a lot to draw the roof permitter by tracing the house & give it a 24" overhang.
(defun C:DrawO (/ pt1 pt2 usercmd str en1 en2 )
;;; ------- Some Housekeeping ------------------
(setq usercmd (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setvar "PLINEWID" 0)
(setq useros (getvar "osmode")
str "")
(setvar "osmode" 175)
(prompt "/nPick points, Enter when done.")
;;; Draw the pline
(setq pt1 (getpoint))
(command "PLINE" pt1 (Setq pt2 (getpoint pt1))) ;_ COMMAND
(while (setq pt2 (getpoint pt2 "\nNext point: "))(command pt2)) ;_ WHILE
(command "")
(princ)
(setq en1 (entlast))
(initget 1)
(setq pto (getpoint "\nSide to offset:"))
(setq dist (getreal "\nEnter offset distance:"))
(command "_.offset" dist en1 pto "")
;(setq en2 (entlast))
(entdel en1) ; remove the user drawn line
(setvar "osmode" useros)
(setvar "CMDECHO" usercmd)
(princ)
) ;_end of defun
A variation of the offset routine I have just for closet shelves.
The houses i draw have odd shaped closets with many sides. The routine
will draw the shelf at 12" with a rod (dashed line) at 10" to the side
I pick after tracing the walls.
I have a routine that inserts arcs on the end of my barrel tile hatch so the roof like looks fancy.
I have a one that after picking the width & depth of the room inserts a text of the dims, (14'-6"X16'-4")
One to hatch between two parallel lines, lets me add a hatch that indicates the exterior block walls.
These are the simple routines that just make life easer & more productive.
The only problem I see is it's addictive & before you know it your in over your head...
But there are plenty of people here that are addicted too. They help me out all the time..
Have Fun
CAB