samifox Posted June 27, 2014 Share Posted June 27, 2014 hi i find it impossible to call a lisp command from the code, for example (command "breakline" p1 p2 mid wont work why is that? Thanks Shay Quote Link to comment Share on other sites More sharing options...
hmsilva Posted June 27, 2014 Share Posted June 27, 2014 hii find it impossible to call a lisp command from the code, for example (command "breakline" p1 p2 mid wont work why is that? Hi Shay, the "breakline" function was not written to be called from other function, however is it possible to call the "breakline" function using a script file, and this can be done in code. As a "demo" (defun c:demo ( / f fo p1 p2 p3 pt1 pt2 pt3) (if (and (setq p1 (getpoint "\nPick start point:")) (setq p2 (getpoint "\nPick end point:")) ) (progn (setq p3 (polar p1 (angle p1 p2) (/ (distance p1 p2) 2)) pt1 (strcat (rtos (car p1) 2 16) "," (rtos (cadr p1) 2 16) "," (rtos (caddr p1) 2 16) ) pt2 (strcat (rtos (car p2) 2 16) "," (rtos (cadr p2) 2 16) "," (rtos (caddr p2) 2 16) ) pt3 (strcat (rtos (car p3) 2 16) "," (rtos (cadr p3) 2 16) "," (rtos (caddr p3) 2 16) ) f "c:/Windows/Temp/temp.scr" fo (open "c:/Windows/Temp/temp.scr" "W") ) (write-line "breakline" fo) (write-line pt1 fo) (write-line pt2 fo) (write-line pt3 fo) (close fo) (command "_.script" "c:/Windows/Temp/temp.scr") ) ) (princ) ) Hope that helps Henrique Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 28, 2014 Share Posted June 28, 2014 You may find you can use breakline I may be wrong but if its a Express lisp then you may need to call it in a different way the example I know is EXTRIM its called by using a different lisp defun sequence. Alternative is to write a defun that does the same thing put in your autoload lisps then its 1 line in your program. Maybe Google "Express Breakline" (load "Extrim") (etrim obj pt1) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 28, 2014 Share Posted June 28, 2014 Found it Breakl.lsp in \program files\autodesk\Autocad 2013\express, directory you will need to go inside the main defun C:Breakline and find the defun start point like extrim above should be able to run using your pts. Maybe just try (C:breakline) in your code much simpler. Quote Link to comment Share on other sites More sharing options...
hmsilva Posted June 28, 2014 Share Posted June 28, 2014 You may find you can use breakline I may be wrong but if its a Express lisp then you may need to call it in a different way the example I know is EXTRIM its called by using a different lisp defun sequence. Alternative is to write a defun that does the same thing put in your autoload lisps then its 1 line in your program. Maybe Google "Express Breakline" (load "Extrim") (etrim obj pt1) The "extrim.lsp" was written to be called from other function, we have the "etrim" function that requires two arguments, ;Entity-TRIM function ;takes: na - entity name ; a - a point, the side to trim on ;NOTE: This function does not allow for the possible miss of ; non-continuous linetypes. ; (defun etrim ( na a / la b d e1 ... Found it Breakl.lsp in \program files\autodesk\Autocad 2013\express, directory you will need to go inside the main defun C:Breakline and find the defun start point like extrim above should be able to run using your pts. Maybe just try (C:breakline) in your code much simpler. As I had previously said, the "breakline" function was not written to be called from other function, with the (C:breakline) we're just calling the "breakline" command, without the possibility of automating the entire command from another routine (that I think to be the OP doubt)... To call the "breakline" from another routine, according to my understanding (worth what it is worth), occurs to me three ways. - using a script - vla-sendcommand method (with hard coded points) - write a code rewriting the "breackl.lsp" and the "c:breakline" function to require points as arguments. Henrique Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 29, 2014 Share Posted June 29, 2014 Henrique your right, Samifox probably quicker to just write your own breakline routine as it will match your criteria. Quote Link to comment Share on other sites More sharing options...
samifox Posted June 29, 2014 Author Share Posted June 29, 2014 yes Henrique is right , incoperating the breakl.lsp to my code is about rewriting the code or hard modifying it. so im writing this functionality by my own. Thanks Shay Quote Link to comment Share on other sites More sharing options...
hmsilva Posted June 29, 2014 Share Posted June 29, 2014 ...Samifox probably quicker to just write your own breakline routine as it will match your criteria. ... im writing this functionality by my own. Shay, as your goal is to incorporate "breakline" in your routine, I agree that it will be much simpler to write your own breakline routine. Henrique Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 29, 2014 Share Posted June 29, 2014 HERE is one I wrote along time ago , hope you like it Quote Link to comment Share on other sites More sharing options...
samifox Posted June 29, 2014 Author Share Posted June 29, 2014 Thank tharwat ( what is the meaning of ur name?) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 29, 2014 Share Posted June 29, 2014 Thank tharwat You're welcome . ( what is the meaning of ur name?) Odd question , Search the net then you may find what you are looking for . Quote Link to comment Share on other sites More sharing options...
samifox Posted June 30, 2014 Author Share Posted June 30, 2014 Its kinf of beverly hills? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 30, 2014 Share Posted June 30, 2014 Its kinf of beverly hills? What is that ? Quote Link to comment Share on other sites More sharing options...
samifox Posted June 30, 2014 Author Share Posted June 30, 2014 Google that beverly hills 90210 Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 30, 2014 Share Posted June 30, 2014 What you want from my name if it has a meaning or it doesn't ? Quote Link to comment Share on other sites More sharing options...
samifox Posted June 30, 2014 Author Share Posted June 30, 2014 Just curios... Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 30, 2014 Share Posted June 30, 2014 Just curios... ........... Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 1, 2014 Share Posted July 1, 2014 Whats in a name, BIGAL the nickname of the notorious gangster Al Capone. Quote Link to comment Share on other sites More sharing options...
samifox Posted July 1, 2014 Author Share Posted July 1, 2014 When i was a theenager i dream a lot about the 80' popsrar samantha fox. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 2, 2014 Share Posted July 2, 2014 When i was a theenager i dream a lot about the 80' popsrar samantha fox Your spelling suggests still dreaming 80' high pop star 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.