Jump to content

Recommended Posts

Posted

I got the 'LD" leader to work. Is there a way to scale it or get it to be controlled by dimscale?

Thank you for your help.

 

 

I'm trying the other one from iconeo also but no luck on it yet. It's real confusing. When Remark so graciously and kindly showed me that defun c:'s can be used at the end of a .lsp as well as the beginning I just was so in awl over his big heartedness or was it his bigheadedness. What ever............

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

  • ReMark

    10

  • bbryson_2000

    10

  • tombu

    8

  • iconeo

    4

Top Posters In This Topic

Posted Images

Posted

Had to go there didn't you?

 

You can lead a horse to water but you can't rip his lips off.

Posted

Well you can rip lips off, just makes it harder to drink...

 

Sent from my SM-G920T using Tapatalk

Posted

You are correct in that scenario. But I'm just learning to drive the car and haven't gotten to the changing of the tire yet.

Please be patient. The next question will show you just how new to this I am:

When I copied your code to a .lsp file I just gave it the name ARROW.lsp

In the code below do I put the name of my (block) arrow in the parentheses?

After loading ARROW.lsp WHAT DO I TYPE TO START IT?

 

 

 

 

(defun c:addblocktoend_singlearrow ()

(setq slocation "L:\\BLOCKS\\ELECTRICAL\\BLOCKS\\") I CHANGED THE ADDRESS OF THE ARROW

(setq sblock "ldr_single_arrow") DO I DO ANY THING HERE?

(setq sscale (/ (getvar "dimscale") 12))

(setq slayer "S-ANNO-DIMS")

 

(addblocktoend slocation sblock sscale slayer)

)

Posted

This is for Remark only:

Had to go there didn't you?

You don't know the difference between complaining and asking for help.

I haven't complained yet but I think I need to start.

You have no patience for people who are trying to learn and asking for help.

You add nothing to the conversation in the way of help.

Your a critical minded person and all you want to do is be critical and belittle people.

Stay out of the conversation if you can't help.

You don't have the temperament to help.

Posted

You can name the lisp routine anything you want just make it easy to be remembered/recognized.

 

Yes, you have to put the name of YOUR block where it currently reads "ldr_single_arrow".

 

To utilize the lisp routine one option is to load it using the APPLOAD command at the command line. Basically you are telling AutoCAD which lisp routine you want to run by browsing to its location and loading it.

 

To actually RUN the command you have to enter what is indicated after defun c: at the command line which, in my opinion, is too much to type and should be changed / shortened. Ex. - HRARRW (short for Home Run Arrow).

Posted
I got the 'LD" leader to work. Is there a way to scale it or get it to be controlled by dimscale?

Thank you for your help.

Sorry, our two dimension styles are both Annotative so they're drawn correctly at any Annotative scale or space. So it's been many years since I've used dimscale, it's set to 0.0 in our drawings. Have you tried using it after changing the Annotation Scale of the current scale? I set it up so it would be at an appropriate size for the current view. You may find it does what you need. You should think about Annotative Dimension Styles as well, I remember having to have Dimension Styles for every scale we used in drawings years ago. It was frustrating, Annotative Dimension Styles is in my top ten of improvements they made to AutoCAD in the 24 years I've been using it.

 

 

I'm trying the other one from iconeo also but no luck on it yet. It's real confusing. When Remark so graciously and kindly showed me that defun c:'s can be used at the end of a .lsp as well as the beginning I just was so in awl over his big heartedness or was it his bigheadedness. What ever............

 

Actually DeFun Defines a Function and if the function name is prefixed by c: then it can be entered at the command line, but cannot require an argument. It must be the first line of the function definition. iconeo's

(defun rtd (x) (* x (/ 180.0 pi)))

function converts radians to degrees and requires an argument (x). So

(rtd pi)

returns 180.0 using pi as the argument.

Posted (edited)

I modified the lisp to draw the arrow to match the one in your drawing with the drawings setting of 1 for dimscale. To run it enter ldbb.

;| Arc Leader for labeling
  BY: Tom Beauford
  BeaufordT@LeonCountyFL.gov
  Leon County Public Works Engineering Section
  Macro: ^P(or C:ld (load "Leaderbbryson.lsp"));ld
  Command line: (load "Leaderbbryson.lsp") ldbb
================================================|;
(defun C:ldbb (/ *ERROR* st_txt osm othm cur_lt pt1 pt2)

(defun *ERROR* (s)                  ; If an error (such as CTRL-C) occurs
 (if (/= s "Function cancelled")     ; while this command is active...
   (princ (strcat "\nError: " s))
 )
 (redraw)
 (setq s nil)
 (setvar "osmode" osm)
 (setvar "orthomode" othm)
 (setvar "celtype" cur_lt)
 (setvar "plinewid" 0.0)
 (setvar "cmdecho" 0)
 (grtext -1 "") ;CLEAR STATUS LINE
 (command "_REGEN")
 (setq *error* olderr)               ; Restore old *error* handler
 (princ)
)

; (setq st_txt (strcat "Arrow size = Text Size = " (rtos(/ 0.1 (getvar "cannoscalevalue"))2 2)))
(setq st_txt (strcat "Arrow size = DimScale = " (rtos(getvar "dimscale")2 2)))
; (setq st_txt (strcat "Arrow size = Text Size = " (rtos(getvar "textsize")2 2)))
(grtext -1 st_txt)
(setq osm (getvar "osmode"))
(setq othm (getvar "orthomode"))
(setq cur_lt (getvar "celtype"))
(setvar "osmode" 0)
(setvar "orthomode" 0)
(setvar "celtype" "CONTINUOUS")
(setq
 pt1 (getpoint "Start at object to be labeled: ")
 pt2 (getpoint pt1 "Tangent Direction Point: "))
(setq
 pt1 (list(car pt1)(cadr pt1))
 pt2 (list(car pt2)(cadr pt2))
 pt2
  (list
;    (- (car pt1)(* (/ (/ 0.1 (getvar "dimscale")) (distance pt1 pt2)) (-(car pt1)(car pt2))))
;    (- (cadr pt1)(* (/ (/ 0.1 (getvar "dimscale")) (distance pt1 pt2))  (-(cadr pt1)(cadr pt2))))
   (- (car pt1)(* (/ (* 0.1 (getvar "dimscale")) (distance pt1 pt2)) (-(car pt1)(car pt2))))
   (- (cadr pt1)(* (/ (* 0.1 (getvar "dimscale")) (distance pt1 pt2))  (-(cadr pt1)(cadr pt2))))
  )
)
(setvar "cmdecho" 0)
(command "_pline" pt1 "w" 0 (/ (getvar "dimscale") 30)
     pt2 "a" "w" 0 0)
(setvar "cmdecho" 1)
(while (= 1 (logand 1 (getvar "cmdactive")))
  (command PAUSE)
)
(setvar "plinewid" 0.0)
(setvar "osmode" osm)
(setvar "orthomode" othm)
(setvar "celtype" cur_lt)
(setvar "cmdecho" 0)
(grtext -1 "") ;CLEAR STATUS LINE
(command "_REGEN")
(princ)
)

;|
((lambda ( / p1 p2 ll pt_m px1 px2 key p3 px3 px4 pt_cen rad inc ang nm lst_pt pa1 pa2)
(initget 9)
(setq p1 (getpoint "\nFirst point: "))
(initget 9)
(setq p2 (getpoint p1 "\nNext point: "))
(setq
   ll (list p1 p2)
   pt_m
	(mapcar
		'/
		(list
			(apply '+ (mapcar 'car ll))
			(apply '+ (mapcar 'cadr ll))
			(apply '+ (mapcar 'caddr ll))
		)
		'(2.0 2.0 2.0)
	)
	px1 (polar pt_m (+ (angle p1 p2) (* pi 0.5)) (distance p1 p2))
	px2 (polar pt_m (- (angle p1 p2) (* pi 0.5)) (distance p1 p2))
)
(princ "\nLast point: ")
 (while (and (setq key (grread T 4 0)) (/= (car key) 3))
   (cond
     ((eq (car key) 5)
       (redraw)
       (setq
         p3 (cadr key)
         ll (list p1 p3)
         pt_m
         (mapcar
           '/
           (list
             (apply '+ (mapcar 'car ll))
             (apply '+ (mapcar 'cadr ll))
             (apply '+ (mapcar 'caddr ll))
           )
           '(2.0 2.0 2.0)
         )
         px3 (polar pt_m (+ (angle p1 p3) (* pi 0.5)) (distance p1 p3))
         px4 (polar pt_m (- (angle p1 p3) (* pi 0.5)) (distance p1 p3))
         pt_cen (inters px1 px2 px3 px4 nil)
       )
       (cond
         (pt_cen
           (setq
             rad (distance pt_cen p3)
             inc (angle pt_cen p1)
             ang (+ (* 2.0 pi) (angle pt_cen p3))
             nm (fix (/ (rem (- ang inc) (* 2.0 pi)) (/ (* pi 2.0) 36.0)))
             lst_pt '()
           )
           (repeat nm
             (setq
               pa1 (polar pt_cen inc rad)
               inc (+ inc (/ (* pi 2.0) 36.0))
               pa2 (polar pt_cen inc rad)
               lst_pt (append lst_pt (list pa1 pa2))
             )
           )
           (setq lst_pt (append lst_pt (list (if pa2 pa2 p1) p3)))
           (grvecs lst_pt)
         )
       )
     )
   )
 )
(prin1)
))
|;

 

You do need to chill though. ReMark helps folk on this forum more than anyone else I can think of. iconeo posted his code weeks ago and you waited till now to complain it wasn't written how you expected it to be when clearly you had no idea what this code is supposed to look like. This is as generous and friendly a forum as you will find. Try to show a little respect in return for those taking the time to try and help you. If it wasn't Friday I may not have kept responding to you myself.

Edited by tombu
Modified it to work with different dimscales
Posted

You've been a big help and I thank you.

Posted

Now that was informative and precise help without attitude and I understood exactly what you said. I thank you very much for your time.

Posted

Happy Friday all and happy Father's day. Time to go clam digging!

 

Sent from my SM-G920T using Tapatalk

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