rog1n Posted October 13, 2018 Share Posted October 13, 2018 Hello, I trying to make a lisp to insert (or maybe draw) a arrow that shows the value and angle of a vector resultant (this part is ok) , my problem is I need to insert the atributtes aligned like that: but if I try to use rotation in this block the text is wrong orientation when angle is >90° and <269° like that: I tryng to use actions of dynamic block but I dont know how to control this actions by lisp. I need help with this or maybe a better solution to do this, can you help me? r.dwg Quote Link to comment Share on other sites More sharing options...
dlanorh Posted October 13, 2018 Share Posted October 13, 2018 (edited) Can you post the drawing in 2010 format, as well as any lisp you already have. Its a simple matter of redefining each attributes rotation once the block is inserted if the angle is within the range. Edited October 13, 2018 by dlanorh Quote Link to comment Share on other sites More sharing options...
rog1n Posted October 13, 2018 Author Share Posted October 13, 2018 Hello, (defun c:test () (setq centro (getpoint "\nEntre com o ponto central do diagrama: ")) ;I have a function that return me angR (in radians) and FR as string (setq angR 2.617993878) ; Just for example angR=150 degrees and FR=100 DaN (setq FR "100 DaN") (command "-insert" "r" "_s" "1" centro (angtos angR) FR (angtos angR)) ) r.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 14, 2018 Share Posted October 14, 2018 (edited) Do more searching here there is a dynamic block that looks at the orientation and changes the text angle, it uses 4 attributes and changes the invisibilty of 3 of them so arrow is always correct. I remember making some comments Edited October 14, 2018 by BIGAL Quote Link to comment Share on other sites More sharing options...
dlanorh Posted October 14, 2018 Share Posted October 14, 2018 (edited) Attached are a drawing "IR.dwg" which contains a revised block and a lisp "IR.lsp" I have removed one of the rotation parameters from the block as it wasn't needed, and rename the remaing one to "Text_Ang". The block is inserted at the entered rotation angle. I have also altered the block contents so that they are on layer "0" and color "byblock", so that the block is universal. I have also altered the attribute justifications to "middle" for the "R" attribute and "middle center" for the "A" attribute. Save the lisp file in your documents folder and load it by typing "appload" then navigating to where you have saved it, selecting it and press the "load" button, then the "close" button. Type "IR" on the command line to start the lisp. I have assumed that you are working in Degrees, but the lisp is altereable if you are not. It will ask for the insertion point, the angle you require it at (in degrees) and the force? (attribute "R" text) It will then insert the block on the current active layer at the specified angle and will fill in the block attributes. If the block rotation is >90 and <270 it will automaticaly rotate the attributes to a readable position. There is no error checking. If you require the block to always be on a certain layer; it is possible to expand the lisp to ensure that the layer is present and create it if not, then insert the block onto that layer. Any problems let me know. IR.dwg IR.lsp Edited October 14, 2018 by dlanorh spelling Quote Link to comment Share on other sites More sharing options...
rog1n Posted October 14, 2018 Author Share Posted October 14, 2018 Thank you dlanorh, this exactly I needed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.