Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

autolisp while

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
825 Views, 4 Replies

autolisp while

(defun c:ok ()
(setq osm (getvar "osmode"))  
(terpri)
(setq y1 (getreal "yazının yüksekliğini giriniz :")) 
(terpri)
(setq en (getreal "ok işaretinin genişliğini giriniz :")) 
(terpri)
(setq p1 (getpoint "ok işaretinin başlangıç noktasını giriniz"))
(terpri)
(setq p2 (getpoint "ok işaretinin bitiş noktasını giriniz"))
(setq mesafe (distance p1 p2))  
(setq açı (angle p1 p2)) 
(setq n1 (polar p1 (- açı (/ pi 2)) (* 0.5 en))) 
(setq n2 (polar n1 açı (- mesafe (* 1.5 en)))) 
(setq n3 (polar n2 (- açı (/ pi 2)) en))
(setq n4 (polar p1 (+ açı (/ pi 2)) (* 0.5 en)))
(setq n5 (polar n4 açı (- mesafe (* 1.5 en))))
(setq n6 (polar n5 (+ açı (/ pi 2)) en))
(setq i 1)


(while (> i 6)
(setq ni (strcat "n" i))
(setq nix (strcat "n" (+ i 1)))
(setq nmes (distance ni nizx))
(setq naçı (angle ni nix ))
(setq nderece (atof (angtos naçı 0 2)))
(setq norta (polar ni naçı (/ nmes 2 )))
(setq nyazı (strcat "l=" nmes))
(command "text" "j" "tc" norta y1 nderece nyazı )

)

(command "osmode" 0)
(command "pline" n1 n2 n3 p2 n6 n5 n4 "close") ; 8
(setvar "osmode" osm)
)

--------------------------------------------------------------------

kalın ve altı çizili kodları bir türlü ayarlayamadım

yapmak istediğimi resimde gösteriyorum. 

yardımcı olursanız çok sevinirim..

 

 

Adsız.jpg

4 REPLIES 4
Message 2 of 5
tramber
in reply to: Anonymous

I don't speak your language but :

  • Your post is in a LT forum !
  • (setq ni (strcat "n" i)) can't work. Neither (strcat "l=" nmes)

(strcat "n" (itoa i)) can

I didn't try

Message 3 of 5
hwalker
in reply to: Anonymous

LT does not use lisp. Try posting in the lisp forums. The link is below

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bd-p/130

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

Message 4 of 5
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

....
(command "text" "j" "tc" norta y1 nderece nyazı )
....

--------------------------------------------------------------------

kalın ve altı çizili kodları bir türlü ayarlayamadım

....

[Google translator from Turkish:

I couldn't set a kind of bold and underline codes ....]


 

Since it's plain Text, there is no code for bold-face -- you would need to either use a bolder font in the Style assigned to the Text, or use Mtext.  For plain text to be underlined, if you want the whole thing  underlined, add "%%U" at the beginning of the text string in your (strcat) function.

Kent Cooper, AIA
Message 5 of 5
Anonymous
in reply to: Kent1Cooper

I solved the problem

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/while-i-apply/m-p/8849290#M386292

 

Command: (setq n1 5)
5

Command: (eval (read "n1"))
5

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report