Visual LISP, AutoLISP and General Customization
Turn on suggestions Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Showonly | Search instead for
Did you mean:
Lisp to generate coordinates in this way
6 REPLIES 6
SOLVED
Back to AutoCAD Customization Category
Back to Topic Listing
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Back to Topic Listing
- Previous
- Next
Message 1 of 7
Anonymous
3881 Views, 6 Replies
11-05-201710:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-05-201710:11 AM
Lisp to generate coordinates in this way
I need a routine that will generate the coordinates in AutoCAD in the way shown in the image,Thank you in advance for helping me.
Solved!Go to Solution.
Solved by Michiel.Valcke. Go to Solution.
Solved by hanslammerts. Go to Solution.
Solved by imadHabash. Go to Solution.
Report
0Likes
Reply
- Back to Topic Listing
- Previous
- Next
6 REPLIES 6
Message 2 of 7
imadHabash
in reply to:Anonymous
11-05-201712:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-05-201712:27 PM
HI,
There is NO need for a lisp , you can prepare it and use it from TextFIELD command . follow this tutorial link to learn how to prepare it. >> Click <<
Regards,
Imad Habash
Report
1Like
Reply
Message 3 of 7
hanslammerts
in reply to:imadHabash
11-05-201702:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-05-201702:08 PM
A field is the best way!
I used to to this with some code too, .. earlier.. 😛
;**************************************************************; ************************************************; functions to PLACE coordinat layer in X_crd...(DEFUN c:cdr_old () (setq oldcolorline (getvar "DIMCLRD")) (setvar "DIMCLRD" 1) (setq txttekst (getvar "users2")) (command "Mtext" "@" "@" " " "") (command "erase" "last" "") (setq getsize (getvar "textsize")) (setq str_getsize (rtos getsize 2 1)) (setq txttekst_text (strcat txttekst "" )) ; or (strcat txttekst "_" str_getsize) (setq searchlayer (tblsearch "layer" txttekst_text)) (setq setcolor "7") (COMMAND "UCSICON" "ON") (SETVAR "CMDECHO" 0) (SETQ CDS (GETVAR "DIMSTYLE")) (prompt (strcat "\nDimstyle " CDS " is current.")) (WHILE (setq PUNT (getpoint "\nSelect point, <Return> to end ...")) (setq wcsPUNT (trans PUNT 1 0)) (if (= searchlayer nil) (progn (setq orlayer (getvar "clayer")) (setq searchlayer3 (tblsearch "layer" "X_crd_")) (if (= searchlayer3 nil) (progn (command "-layer" "m" "X_crd_" "") )(command "-layer" "t" "X_crd_" "s" "X_crd_" "c" "7" "" "")) (predef_layer_style_coor) (command "-layer" "n" txttekst_text "c" setcolor "" "") ) (progn (setq orlayer (getvar "clayer")) (setq searchlayer3 (tblsearch "layer" "X_crd_")) (if (= searchlayer3 nil) (progn (command "-layer" "m" "X_crd_" "") )(command "-layer" "t" "X_crd_" "s" "X_crd_" "c" "7" "" "")) (predef_layer_style_coor) (command "-layer" "s" txttekst "c" setcolor "" ""); cahnge layer gebruiken ) ); end of if layers maken set layer (command "-layer" "s" txttekst_text ""); change layer gebruiken ;(command "ucs" "WORLD") (setq getm_of_mm (getvar "insunits")) ; 4 voor mm, 6 voor m (if (= getm_of_mm 4) (SETQ XPUNT (/ (CAR wcsPUNT) 1000)) ()) (if (= getm_of_mm 4) (SETQ YPUNT (/ (CADR wcsPUNT) 1000)) ()) (if (= getm_of_mm 4) (SETQ ZPUNT (/ (CADDR wcsPUNT) 1000)) ()) ;CODE VOOR Z (if (= getm_of_mm 6) (SETQ XPUNT (/ (CAR wcsPUNT) 1)) ()) (if (= getm_of_mm 6) (SETQ YPUNT (/ (CADR wcsPUNT) 1)) ()) (if (= getm_of_mm 6) (SETQ ZPUNT (/ (CADDR wcsPUNT) 1)) ()) ;(command "ucs" "VIEW") (setq var (* 10 (/ 1 (getvar "cannoscalevalue"))) PLAATS (getpoint (strcat "\nENTER for @" (rtos var 2 (if (= var (fix var)) 0 3)) "<30\): "))) (SETQ PUNTUCS (TRANS PUNT 0 1)) (if (= getm_of_mm 4) (SETQ XTEKST (STRCAT "X = " (RTOS XPUNT 2 3))) ()) (if (= getm_of_mm 4) (SETQ YTEKST (STRCAT "Y = " (RTOS YPUNT 2 3))) ()) (if (= getm_of_mm 4) (SETQ ZTEKST (STRCAT "Z = " (RTOS ZPUNT 2 3))) ()) (if (= getm_of_mm 6) (SETQ XTEKST (STRCAT "X = " (RTOS XPUNT 2 2))) ()) (if (= getm_of_mm 6) (SETQ YTEKST (STRCAT "Y = " (RTOS YPUNT 2 2))) ()) (if (= getm_of_mm 6) (SETQ ZTEKST (STRCAT "Z = " (RTOS ZPUNT 2 2))) ()) (if (not PLAATS) (setq PLAATS (polar PUNTUCS (/ pi 6) var))) (setvar "DIMCLRD" oldcolorline) (setq oldmode (getvar "osmode")) (setvar "osmode" 0) (COMMAND "LEADER" PUNT PLAATS "" XTEKST YTEKST "") (setvar "osmode" oldmode) (command "-layer" "s" orlayer "") ; change layer gebruiken ;(command "change" "last" "" "p" "la" txttekst "") ; change layer gebuiken ; (SETQ STOP (GETREAL "\nESC om te stoppen.. ")) ;(command "ucs" "view") ) (PRINT))
Report
0Likes
Reply
Message 4 of 7
Kent1Cooper
in reply to:Anonymous
11-05-201707:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-05-201707:29 PM
I would guess that a little Searching in this Forum and especially the Customization Forum would find something that will do that, or very close to it.
Kent Cooper, AIA
Report
0Likes
Reply
Message 5 of 7
-FDC-
in reply to:imadHabash
11-05-201709:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-05-201709:11 PM
A block with field attributes is indeed the best way to do it.
But is there a way to create a "dynamic" border around the text?
Report
0Likes
Reply
Message 6 of 7
imadHabash
in reply to:-FDC-
11-05-201710:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-05-201710:05 PM
Hi,
>>A block with field attributes is indeed the best way to do it. <<
Yes that's right and that what i mean it with text FIELD . this is text option that you can then convert it to attributes to get what you need and this is clear in the link that i post it.
>>But is there a way to create a "dynamic" border around the text? <<
by using a lisp you can do it. attached lisp file Create associative textbox .
Regards,
Imad Habash
AssociativeTextboxV1-2.lsp
Report
1Like
Reply
Message 7 of 7
Michiel.Valcke
in reply to:imadHabash
11-06-201712:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-06-201712:46 AM
If you use a MLEADER as the basis for your block you can set a text frame in the properties. (see screenshot)
You can also set a background mask (and even give it a color) if you should be interested in that.
No need for a .lsp
Report
1Like
Reply
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Back to Topic Listing
- Previous
- Next