Jump to content

LISP Request - Elevations


Bill Tillman

Recommended Posts

I'm constantly hounded by requests from the field to give them the top of steel elevation of this, bottom of steel elevation of that. So I'm looking for something to basically do this:

 

1. Enter the elevation of the baseline, which usually would be the top of the 1st floor slab, or it will just default to 0'-0"

 

2. Then by simply clicking on the points I want the items shown in the attached jpg will appear, formatted in feet/inches.

 

3. This will always be separate from the regular submittal drawings so it should create it's own layer and keep everything in there.

 

I started this myself but then realized I still just don't know enough about LISP to make it work.

elev.jpg

Link to comment
Share on other sites

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    12

  • Bill Tillman

    10

  • TimSpangler

    1

I'm constantly hounded by requests from the field to give them the top of steel elevation of this, bottom of steel elevation of that. So I'm looking for something to basically do this:

 

1. Enter the elevation of the baseline, which usually would be the top of the 1st floor slab, or it will just default to 0'-0"

 

2. Then by simply clicking on the points I want the items shown in the attached jpg will appear, formatted in feet/inches.

 

3. This will always be separate from the regular submittal drawings so it should create it's own layer and keep everything in there.

 

I started this myself but then realized I still just don't know enough about LISP to make it work.

 

I use a DB's for this:

 

Elevation marker gets used when doing elevations. It is added to a dim string.

 

Foundation Marker is used on foundation plans to call out wall, pier, footing heights.

 

Maybe a combo of the 2. It can be done is lisp but its alot of code for something as small as this. $0.02

 

Tim

ElevationMarker.dwg

FoundationMarker.dwg

Link to comment
Share on other sites

Okay, I've got it started and it's working to some degree. What I need assistance with is how to get this to put the elevation marker at the getpoint location and then format the text so that it's a little cleaner, left aligned and the fraction in the ytxt point formated to be diagonally stacked.

 

And I guess a few error traps would be nice to polish this one off nicely.

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;   Filename: elevlabel.lsp
;;   Date: 2009-04-20    12:12:23 PM
;;
;;   Takes input from user and plots elevation mark along with the elevation
;;   dimension in Feet/Inches format using the Y point for reference.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun C:elevlabel  ()
 (setq pt1 (getpoint "\nSelect your elevation point:"))
 (while pt1
   (setq UCSpt (trans pt1 0 1)
    ytxt (strcat "ELEV: " (rtos (/ (cadr UCSpt) 12) 4 4)))
 (command "text" "j" "m" pt1 "3" "0" ytxt)
 (setq pt1 (getpoint "\nSelect your elevation point:"))
  )
)

Link to comment
Share on other sites

Something like this to start you off maybe?

 

(defun c:elab  (/ bspt iPt elev)
 (or elev:base (setq elev:base 0.0))
 (setq bspt (getreal (strcat "\nSpecify Base Elevation <" (rtos elev:base) ">: ")))
 (or (not bspt) (setq elev:base bspt))
 (while (setq iPt (getpoint "\nClick for Elevation Marker: "))
   (setq elev (- (cadr (trans iPt 0 1)) elev:base))
   (Make_Text iPt (strcat "ELEV: " (rtos elev 4 4)) 0.0))
 (princ))

(defun Make_Text  (pt val rot)
 (entmake (list '(0 . "TEXT")
                '(8 . "0")
                (cons 10 pt)
                (cons 40 (getvar "TEXTSIZE"))
                (cons 1 val)
                (cons 50 rot)
                (cons 7 (getvar "TEXTSTYLE"))
                '(71 . 0)
                '(72 . 1)
                '(73 . 2)
                (cons 11 pt))))

 

Haven't got much time today, sorry :wink:

Link to comment
Share on other sites

Thanks Lee. I seem to be much more ignorant of UCS and WCS when it comes to this than I thought. If I move the UCS which I would want to do with this, I end up with some pretty strange results.

 

I'll keep hacking tonight and check back later.

Link to comment
Share on other sites

No, no, the UCS is good.....the UCS is our friend...

 

I too wish I could ignore it, but the fact is I never know what the other guy who prepared the drawings used and I need a way to accurately show elevations to the crew in the field.

Link to comment
Share on other sites

To explain my intent clearly, I would need the LISP code to allow one to enter elevations and then a few minutes later adjust the UCS origin to a new location. You have to understand that it's not unusual at all for a benchmark to be changed or to find out that someone gave me the wrong benchmark (happens more than we want to admit).

 

(defun c:elab ( / pt1 UCSpt ytxt)
  (setq pt1 (getpoint "\nSelect your elevation point:"))
  (while pt1
     (setq UCSpt (trans pt1 0 1)) 
     (setq ytxt (strcat " ELEV: " (rtos (cadr UCSpt) 4 4)))
  (command "text" "j" "bl" pt1 "3" "0" ytxt)
  (setq pt1 (getpoint "\nSelect your elevation point:"))
  )
(princ pt1)
(princ UCSpt)
(princ)
)

 

I draw some horizontal lines and run the code above using the right end of each line as a point to be selected. The elevations are printed as expected although it doesn't format even feet properly leaving off the inches...ie 20' in lieu of 20'-0" which is desired.

 

Then I move the UCS say 72" in the positive Y direction. So now my elevation of 20'-0" should be 14'-0" or at least that's what my intentions are. But instead the elevation now shows up at 8'-0". And when I select the new UCS origin point which should be elevation 0'-0" it shows up as -6'-0". Crazy I know or it shows that I still don't really comprehend what moving the origin of the UCS is all about.

 

UPDATE: OK I found my error. The trans function should look like this:

(setq UCSpt (trans pt1 0 2))

 

But to be honest, I would think that WCS (0) to Current UCS (1) is what would work. Instead it required the code above to work properly. Now I need to add the following things to this code:

 

1. Get it to format even feet to show feet and inches. The guys in the field have to have this, without it they will come crying back to my office saying they don't know if it says 20' or 20".

 

2. The finshed text needs to include the elevation symbol. I assume I could create a block for this and have the code insert the the symbol on the point selected.

 

3. The text should then be positioned slightly to the right of the elevation symbol.

 

4. Oh, yes, I almost forgot. The code will need to create a layer for these elevation marks and place all the text and symbols into this layer. The text I'm creating with this needs only to show up on certain copies of the prints. The submittal drawings for example don't need this but I would like to run a copy just for the field which will include all of these "cheat notes" as they call them. Anything to help them get it done right the first time.

 

And I've shorthened the code down to just this:

 

(defun c:elab ( / pt1)
  (setq pt1 (getpoint "\nSelect your elevation point:"))
  (while pt1
     (command "text" "j" "bl" pt1 "3" "0" (strcat " ELEV: " (rtos (cadr (trans pt1 0 
2)) 4 4)))
     (setq pt1 (getpoint "\nSelect your elevation point:"))
  )
(princ)
)

 

BTW - Thanks for your advice. I'm getting familiar with the syntax and that makes it easier to code.

Link to comment
Share on other sites

Thanks again for your valuable input. I made a block but I can see that unless this block exists in each drawing I'll have to create or copy each time. Perhaps there is a way to do this as an external reference...

 

It's starting to take shape but the wife is now pressing me to put it to rest for the night. I refined the code a little further. Still needs error trapping and the steps to create a layer for these objects. I would also like to use your method with the MakeText function but that's producing an error right now which I can't seem to debug.

 

(defun c:elab ( / pt1)
  (setq pt1 (getpoint "\nSelect elevation point:"))
  (while pt1
    (command "insert" "ElevMk" pt1 "1" "1" "0" "0")
    (command "text" "j" "bl" pt1 "3" "0" "      T.O. STEEL")
    (command "text" "j" "tl" pt1 "3" "0" (strcat "      ELEV: " (rtos (cadr trans pt1 0 2)) 4 4)))
    (setq pt1 (getpoint "\nSelect elevation point:"))
  )
(princ)
)

 

This now produces this at the desired input points:

elev01.jpg

Link to comment
Share on other sites

1. Get it to format even feet to show feet and inches. The guys in the field have to have this, without it they will come crying back to my office saying they don't know if it says 20' or 20".

 

I think this is a DIMZIN problem to be honest. - have a look in the ACAD help of DIMZIN.

 

2. The finshed text needs to include the elevation symbol. I assume I could create a block for this and have the code insert the the symbol on the point selected.

 

You could also "entmake" the block within the LISP code. - I will have a look at posting an example :)

 

4. Oh, yes, I almost forgot. The code will need to create a layer for these elevation marks and place all the text and symbols into this layer. The text I'm creating with this needs only to show up on certain copies of the prints. The submittal drawings for example don't need this but I would like to run a copy just for the field which will include all of these "cheat notes" as they call them. Anything to help them get it done right the first time.

 

This can be easily achieved. :D

 

 

I shall take another look at the code for you Bill, see what I can do :)

 

 

Cheers

 

Lee

Link to comment
Share on other sites

Here's a cheats way :P

 

(defun c:elab (/ *error* ovar vlst doc spc ePt tPt tStr)
 (vl-load-com)
 
 (defun *error* (msg)
   (if ovar (mapcar 'setvar vlst ovar))
   (if (not (member msg '("Function cancelled" "quit / exit abort")))
     (princ (strcat "\nError: " msg))
     (princ "\n<<-- cancelled -->>"))
   (princ))

 (setq doc (vla-get-ActiveDocument
             (vlax-get-acad-object))
       spc (if (zerop (vla-get-activespace doc))
           (if (= (vla-get-mspace doc) :vlax-true)
             (vla-get-modelspace doc)  ; << Viewport
             (vla-get-paperspace doc))
           (vla-get-modelspace doc)))

 (setq vlst '("CLAYER" "OSMODE" "DIMZIN")
       ovar (mapcar 'getvar vlst))
 (mapcar 'setvar (cdr vlst) '(0 1))
 (mapcar 'setvar '("PDMODE" "PDSIZE") (list 34 (getvar 'TEXTSIZE)))

 (if (not (tblsearch "LAYER" "ELEVTEXT"))
   (vla-add (vla-get-Layers doc) "ELEVTEXT")
   (setvar "CLAYER" "ELEVTEXT"))             
 
 (while (setq ePt (getpoint "\nSelect Elevation Point: "))
   (vla-addPoint spc (vlax-3D-point ePt))
   (setq tPt (polar ePt 0 (getvar "TEXTSIZE")))
   (Make_Text tPt "T.O. STEEL" 0.0 1)
   (setq tStr (strcat "ELEV: " (rtos (cadr (trans ePt 0 2)) 4 4)))
   (Make_Text tPt tStr 0.0 3))
 (mapcar 'setvar vlst ovar)
 (princ))

(defun Make_Text  (pt val rot flag)
 (entmake (list '(0 . "TEXT")
        (cons 8 "ELEVTEXT")
        (cons 10 pt)
        (cons 40 (getvar "TEXTSIZE"))
        (cons 1 val)
        (cons 50 rot)
        (cons 7 (getvar "TEXTSTYLE"))
        '(71 . 0)
        '(72 . 0)
        (cons 73 flag)
        (cons 11 pt))))

PS> I would STRONGLY advise you use Entmake to create your text instead of a command call - the command call is very very unreliable and can produce some undesired results a lot of the time. Also, entmake is a ton quicker.

Link to comment
Share on other sites

Ok, now without Cheating... :P :P

 

(defun c:elab  (/ *error* ovar vlst doc spc ePt tPt tStr)

 (defun *error*  (msg)
   (if ovar
     (mapcar 'setvar vlst ovar))
   (if (not (member msg '("Function cancelled" "quit / exit abort")))
     (princ (strcat "\nError: " msg))
     (princ "\n<<-- cancelled -->>"))
   (princ))

 (setq doc (vla-get-ActiveDocument
             (vlax-get-acad-object))
       spc (if (zerop (vla-get-activespace doc))
             (if (= (vla-get-mspace doc) :vlax-true)
               (vla-get-modelspace doc)
               (vla-get-paperspace doc))
             (vla-get-modelspace doc)))

 (setq vlst '("CLAYER" "OSMODE" "DIMZIN")
       ovar (mapcar 'getvar vlst))
 (mapcar 'setvar (cdr vlst) '(0 1))
 ;(mapcar 'setvar '("PDMODE" "PDSIZE") (list 34 (getvar 'TEXTSIZE)))

 (if (not (tblsearch "LAYER" "ELEVTEXT"))
   (vla-put-color (vla-add (vla-get-Layers doc) "ELEVTEXT") acYellow)
   (setvar "CLAYER" "ELEVTEXT"))

 (if (not (tblsearch "BLOCK" "eMark"))
   (Make_Block "eMark" (getvar 'TEXTSIZE)))

 (while (setq ePt (getpoint "\nSelect Elevation Point: "))
   (Put_Block ePt "eMark" "ELEVTEXT")
 ;(vla-addPoint spc (vlax-3D-point ePt))
   (setq tPt (polar ePt 0 (* 2.5 (getvar "TEXTSIZE"))))
   (Make_Text tPt "T.O. STEEL" 0.0 1)
   (setq tStr (strcat "ELEV: " (rtos (cadr (trans ePt 0 2)) 4 4)))
   (Make_Text tPt tStr 0.0 3))
 (mapcar 'setvar vlst ovar)
 (princ))

(defun Make_Text  (pt val rot flag)
 (entmake (list (cons 0 "TEXT")
                (cons 8 "ELEVTEXT")
                (cons 10 pt)
                (cons 40 (getvar "TEXTSIZE"))
                (cons 1 val)
                (cons 50 rot)
                (cons 7 (getvar "TEXTSTYLE"))
                (cons 71 0)
                (cons 72 0)
                (cons 73 flag)
                (cons 11 pt))))

(defun Make_Block  (Nme Rad)

 (entmake (list (cons 0 "BLOCK")
                (cons 2 Nme)
                (cons 10 (list 0 0 0))
                (cons 70 0)))

 (entmake (list (cons 0 "CIRCLE")
                (cons 8 "0")
                (cons 10 (list 0 0 0))
                (cons 40 Rad)))

 (entmake (list (cons 0 "LINE")
                (cons 8 "0")
                (cons 10 (list 0 (* 2 Rad) 0))
                (cons 11 (list 0 (* -2 Rad) 0))))

 (entmake (list (cons 0 "LINE")
                (cons 8 "0")
                (cons 10 (list (* -2 Rad) 0 0))
                (cons 11 (list (* 2 Rad) 0 0))))

 (entmake (list (cons 0 "ENDBLK") (cons 8 "0"))))

(defun Put_Block  (pt Nme lay)
 (entmake (list (cons 0 "INSERT")
                (cons 8 lay)
                (cons 2 Nme)
                (cons 10 pt))))


Link to comment
Share on other sites

Lee,

 

Thanks again dude, that's a really cool an quick method for getting these elevations on the page accurately. But I notice that it doesn't take into account the adjustment of the UCS. I'll keep hacking at this one because this is the probably the most important step, that I be able to set the UCS on the fly and this will print the elevations based on the USC origin, wherever it may be.

 

Thanks.

Link to comment
Share on other sites

I'm not completely happy with it however - as it doesn't include the hatch that you use in your posted drawing.

 

I first used the "Point" command (with PDMODE set to 34), as this almost looks like the symbol you posted (but as I said, thats cheating!). :D

 

I am not confident in entmaking hatch - so I may post a thread detailing the that question.

 

But I shall look into the UCS problem :)

 

Cheers

 

Lee

Link to comment
Share on other sites

Ok, so I posted the thread, then managed to work it out for myself:

 

(defun c:elab  (/ *error* ovar vlst doc spc ePt tPt tStr)

 (defun *error*  (msg)
   (if ovar
     (mapcar 'setvar vlst ovar))
   (if (not (member msg '("Function cancelled" "quit / exit abort")))
     (princ (strcat "\nError: " msg))
     (princ "\n<<-- cancelled -->>"))
   (princ))

 (setq doc (vla-get-ActiveDocument
             (vlax-get-acad-object))
       spc (if (zerop (vla-get-activespace doc))
             (if (= (vla-get-mspace doc) :vlax-true)
               (vla-get-modelspace doc)
               (vla-get-paperspace doc))
             (vla-get-modelspace doc)))

 (setq vlst '("CLAYER" "OSMODE" "DIMZIN")
       ovar (mapcar 'getvar vlst))
 (mapcar 'setvar (cdr vlst) '(0 1))
 ;(mapcar 'setvar '("PDMODE" "PDSIZE") (list 34 (getvar 'TEXTSIZE)))

 (if (not (tblsearch "LAYER" "ELEVTEXT"))
   (vla-put-color (vla-add (vla-get-Layers doc) "ELEVTEXT") acYellow)
   (setvar "CLAYER" "ELEVTEXT"))

 (if (not (tblsearch "BLOCK" "eMark"))
   (Make_Block "eMark" (getvar 'TEXTSIZE)))

 (while (setq ePt (getpoint "\nSelect Elevation Point: "))
   (Put_Block ePt "eMark" "ELEVTEXT")
 ;(vla-addPoint spc (vlax-3D-point ePt))
   (setq tPt (polar ePt 0 (* 2.5 (getvar "TEXTSIZE"))))
   (Make_Text tPt "T.O. STEEL" 0.0 1)
   (setq tStr (strcat "ELEV: " (rtos (cadr (trans ePt 0 2)) 4 4)))
   (Make_Text tPt tStr 0.0 3))
 (mapcar 'setvar vlst ovar)
 (princ))

(defun Make_Text  (pt val rot flag)
 (entmake (list (cons 0 "TEXT")
                (cons 8 "ELEVTEXT")
                (cons 10 pt)
                (cons 40 (getvar "TEXTSIZE"))
                (cons 1 val)
                (cons 50 rot)
                (cons 7 (getvar "TEXTSTYLE"))
                (cons 71 0)
                (cons 72 0)
                (cons 73 flag)
                (cons 11 pt))))

(defun Make_Block  (Nme Rad)

 (entmake (list (cons 0 "BLOCK")
                (cons 2 Nme)
                (cons 10 (list 0 0 0))
                (cons 70 0)))

 (entmake (list (cons 0 "CIRCLE")
                (cons 8 "0")
                (cons 10 (list 0 0 0))
                (cons 40 Rad)))

 (entmake (list (cons 0 "LINE")
                (cons 8 "0")
                (cons 10 (list 0 (* 2 Rad) 0))
                (cons 11 (list 0 (* -2 Rad) 0))))

 (entmake (list (cons 0 "LINE")
                (cons 8 "0")
                (cons 10 (list (* -2 Rad) 0 0))
                (cons 11 (list (* 2 Rad) 0 0))))

 (entmake (list '(0 . "HATCH")
                '(100 . "AcDbEntity")
                '(8 . "0")
                '(62 . 2)
                '(100 . "AcDbHatch")
                '(10 0 0 0)
                '(210 0 0 1)
                '(2 . "SOLID")
                '(70 . 1)
                '(71 . 0)
                '(91 . 1)
                '(92 . 7)
                '(72 . 1)
                '(73 . 1)
                '(93 . 3)
                '(10 0 0 0)
                '(42 . 0)
                (cons 10 (list 0 (* -1 Rad) 0))
                '(42 . 0.414214)
                (cons 10 (list Rad 0 0))
                '(42 . 0)
                '(97 . 0)
                '(75 . 0)
                '(76 . 1)
                '(47 . 0.0334902)
                '(98 . 1)
                '(10 4.67389 5.69586 0.0)))

 (entmake (list '(0 . "HATCH")
                '(100 . "AcDbEntity")
                '(8 . "0")
                '(62 . 2)
                '(100 . "AcDbHatch")
                '(10 0 0 0)
                '(210 0 0 1)
                '(2 . "SOLID")
                '(70 . 1)
                '(71 . 0)
                '(91 . 1)
                '(92 . 7)
                '(72 . 1)
                '(73 . 1)
                '(93 . 3)
                (cons 10 (list 0 Rad 0))
                '(42 . 0.414214)
                (cons 10 (list (* -1 Rad) 0 0))
                '(42 . 0)
                '(10 0 0 0)
                '(42 . 0)
                '(97 . 0)
                '(75 . 0)
                '(76 . 1)
                '(47 . 0.0334902)
                '(98 . 1)
                '(10 4.67389 5.69586 0.0)))

 (entmake (list (cons 0 "ENDBLK") (cons 8 "0"))))

(defun Put_Block  (pt Nme lay)
 (entmake (list (cons 0 "INSERT")
                (cons 8 lay)
                (cons 2 Nme)
                (cons 10 pt))))

 

But I haven't yet looked at the UCS problem :(

Link to comment
Share on other sites

See if this solves the UCS issue:

 

(defun c:elab  (/ *error* ovar vlst doc spc ePt tPt tStr)

 (defun *error*  (msg)
   (if ovar
     (mapcar 'setvar vlst ovar))
   (if (not (member msg '("Function cancelled" "quit / exit abort")))
     (princ (strcat "\nError: " msg))
     (princ "\n<<-- cancelled -->>"))
   (princ))

 (setq doc (vla-get-ActiveDocument
             (vlax-get-acad-object))
       spc (if (zerop (vla-get-activespace doc))
             (if (= (vla-get-mspace doc) :vlax-true)
               (vla-get-modelspace doc)
               (vla-get-paperspace doc))
             (vla-get-modelspace doc)))

 (setq vlst '("CLAYER" "DIMZIN")
       ovar (mapcar 'getvar vlst))
 (setvar "DIMZIN" 1)

 (if (not (tblsearch "LAYER" "ELEVTEXT"))
   (vla-put-color (vla-add (vla-get-Layers doc) "ELEVTEXT") acYellow)
   (setvar "CLAYER" "ELEVTEXT"))

 (if (not (tblsearch "BLOCK" "eMark"))
   (Make_Block "eMark" (getvar 'TEXTSIZE)))

 (while (setq ePt (getpoint "\nSelect Elevation Point: "))
   (Put_Block (trans ePt 1 0) "eMark" "ELEVTEXT")
   (setq tPt (polar (trans ePt 1 0) 0 (* 2.5 (getvar "TEXTSIZE"))))
   (Make_Text tPt "T.O. STEEL" 0.0 1)
   (setq tStr (strcat "ELEV: " (rtos (cadr (trans ePt 1 0)) 4 4)))
   (Make_Text tPt tStr 0.0 3))
 (mapcar 'setvar vlst ovar)
 (princ))

(defun Make_Text  (pt val rot flag)
 (entmake (list (cons 0 "TEXT")
                (cons 8 "ELEVTEXT")
                (cons 10 pt)
                (cons 40 (getvar "TEXTSIZE"))
                (cons 1 val)
                (cons 50 rot)
                (cons 7 (getvar "TEXTSTYLE"))
                (cons 71 0)
                (cons 72 0)
                (cons 73 flag)
                (cons 11 pt))))

(defun Make_Block  (Nme Rad)

 (entmake (list (cons 0 "BLOCK")
                (cons 2 Nme)
                (cons 10 (list 0 0 0))
                (cons 70 0)))

 (entmake (list (cons 0 "CIRCLE")
                (cons 8 "0")
                (cons 10 (list 0 0 0))
                (cons 40 Rad)))

 (entmake (list (cons 0 "LINE")
                (cons 8 "0")
                (cons 10 (list 0 (* 2 Rad) 0))
                (cons 11 (list 0 (* -2 Rad) 0))))

 (entmake (list (cons 0 "LINE")
                (cons 8 "0")
                (cons 10 (list (* -2 Rad) 0 0))
                (cons 11 (list (* 2 Rad) 0 0))))

 (entmake (list '(0 . "HATCH")
                '(100 . "AcDbEntity")
                '(8 . "0")
                '(62 . 2)
                '(100 . "AcDbHatch")
                '(10 0 0 0)
                '(210 0 0 1)
                '(2 . "SOLID")
                '(70 . 1)
                '(71 . 0)
                '(91 . 1)
                '(92 . 7)
                '(72 . 1)
                '(73 . 1)
                '(93 . 3)
                '(10 0 0 0)
                '(42 . 0)
                (cons 10 (list 0 (* -1 Rad) 0))
                '(42 . 0.414214)
                (cons 10 (list Rad 0 0))
                '(42 . 0)
                '(97 . 0)
                '(75 . 0)
                '(76 . 1)
                '(47 . 0.0334902)
                '(98 . 1)
                '(10 4.67389 5.69586 0.0)))

 (entmake (list '(0 . "HATCH")
                '(100 . "AcDbEntity")
                '(8 . "0")
                '(62 . 2)
                '(100 . "AcDbHatch")
                '(10 0 0 0)
                '(210 0 0 1)
                '(2 . "SOLID")
                '(70 . 1)
                '(71 . 0)
                '(91 . 1)
                '(92 . 7)
                '(72 . 1)
                '(73 . 1)
                '(93 . 3)
                (cons 10 (list 0 Rad 0))
                '(42 . 0.414214)
                (cons 10 (list (* -1 Rad) 0 0))
                '(42 . 0)
                '(10 0 0 0)
                '(42 . 0)
                '(97 . 0)
                '(75 . 0)
                '(76 . 1)
                '(47 . 0.0334902)
                '(98 . 1)
                '(10 4.67389 5.69586 0.0)))

 (entmake (list (cons 0 "ENDBLK") (cons 8 "0"))))

(defun Put_Block  (pt Nme lay)
 (entmake (list (cons 0 "INSERT")
                (cons 8 lay)
                (cons 2 Nme)
                (cons 10 pt))))

 

I also changed the setting of the OSMODE, so that snaps wouldn't be turned off unnecessarily. :oops:

Link to comment
Share on other sites

Lee,

 

You are a gentleman and a scholar. Thanks a million for this valuable code that I will scour over and learn the finer point of in more detail.

 

This utility is also going to save loads of time as well as give me an accurate way to hand the field more information.

Link to comment
Share on other sites

Many thanks Bill - I take it that it worked as you desired :D

 

Again, if you have any questions regarding any element of the code, I would be more than happy to go into detail and explain things. :)

 

Lee

Link to comment
Share on other sites

Sorry I didn't get to test this until this morning. I'm not sure what this one is but this error message came up when I tried to run this one.

 

 

Error: no function definition: VLAX-GET-ACAD-OBJECT

 

Any clues?

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...