Jump to content

Add reactor for coordinate dimension


77077

Recommended Posts

Hello . Dear friend.

 

I found this code from CADTutor by Marko.

I hope someone can help me add reactor for this coordinate dimension.

 

Drag the arrows. Coordinate data automatic updates.

 

Thanks for any help.

 

(defun c:lb ( / p x y str )
 (if (not (tblsearch "LAYER" "dim"))
   (entmake '((0 . "LAYER") (100 . "AcDbSymbolTableRecord") (100 . "AcDbLayerTableRecord") (2 . "dim") (70 . 0) (62 . 3) (6 . "Continuous")))
   (prompt "\nLayer : \"dim\" already exist - setting it to current and proceeding with routine...")
 )
 (setvar 'clayer "dim")
 (while (setq p (getpoint "\nPick Point - ENTER to finish: "))
    (setq   x (strcat "X = " (if (minusp (car p)) ""  "+" ) (rtos (car p) 2 2)))
    (setq   y (strcat "Y = " (if (minusp (cadr p)) "" "+" ) (rtos (cadr p) 2 2)))
    (setq str (strcat x "\n" y))
   ;(setq   z (strcat "Z = "(if (minusp (caddr p)) "" "+" ) (rtos (caddr p) 2 2)))
   ;(setq str (strcat x "\n" y "\n" z))                                       
    (command "_LEADER" p pause "" str "")
 )
 (princ)
)

Link to comment
Share on other sites

Hi,

 

There is one video created by alanjt using fields instead of reactors which means permanent use and no need to use codes at all, try to search for it in this forum.

Link to comment
Share on other sites

Do you know how use reactor for coding this ?

Yes I do , but in your case reactor is not needed at all and it might be a troublesome for AutoCAD if you have hundreds so just as demonstrated by Alan is more than enough and I think also it is the best way to go with.

 

Are not you the same guy who posted the reactor code for the same issue in Autodesk forum HERE ?

Link to comment
Share on other sites

Yes I do , but in your case reactor is not needed at all and it might be a troublesome for AutoCAD if you have hundreds so just as demonstrated by Alan is more than enough and I think also it is the best way to go with.

 

Are not you the same guy who posted the reactor code for the same issue in Autodesk forum HERE ?

 

Yes. Is me too. My account forgot password. so I register an new account.

That code is from my friend. But ,He say It's not perfect . when delete "leader" obj will error. and He can't fix that error. so...

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