BlackBox Posted October 22, 2010 Share Posted October 22, 2010 Why can you not write your words in full It would almost enable people to read your demands I believe there is a genuine language barrier, but that is easily overcome. Overcoming the rude, impatient, discourteous, sense of entitlement... that's the biggest obstacle. Quote Link to comment Share on other sites More sharing options...
Guest balajibth84 Posted October 22, 2010 Share Posted October 22, 2010 hay i am asked its possible?y u r getting tension?y u r telling we r not teenage girl....plz talk related the topic plz...... Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2010 Share Posted October 22, 2010 bala: Please use complete words we aren't "texting" here. Your request for this particular code seems to have no basis in reality. What are you really trying to accomplish here? I sense that you are trying to make something that is simple (multiple offsets) more complex than it has to be. What's the point? Quote Link to comment Share on other sites More sharing options...
Guest balajibth84 Posted October 22, 2010 Share Posted October 22, 2010 ok..iu am not asking multioffset..i am try to fix shortcut for offset...so r using the offset(Single line not multiple line) more time.so only i am asking thaty short cut..we r using more time 1,2,3,10,20,25,50,100,300,500..Etc...So i am using the short code for this regular numbers....each and every time i am need new number means i am paste that code and insert that neede text..So we r giving the number 1to15000 means i dont want edit that code every time......we r using offset more time...So only i am asking this short form... (defun c:250() (command "offset" "250" )) Here i want 300 means i want to copy this and insert 300..So here i want to give 1 to 15000.... Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2010 Share Posted October 22, 2010 I like at that and cannot help but feel it is needlessly pointless. It's seems a waste of both time and effort. Yes, lisp is supposed to speed things up especially repetitive/complex tasks but this one is so simple it begs the question "Why bother?" Quote Link to comment Share on other sites More sharing options...
Cad64 Posted October 22, 2010 Share Posted October 22, 2010 I don't understand how this makes your work any easier. All you're doing is eliminating the need to type "o" to start the offset command. But if this is really what you want, then why don't you just create these lisp routines yourself? You already have the code, all you have to do is change the numbers and save to a separate file. Start with this: (defun c:250() (command "offset" "250" )) Change to this: (defun c:300() (command "offset" "300" )) Save As 300.lsp Now just do that 15,000 more times. Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2010 Share Posted October 22, 2010 Wouldn't that be 14,998 more times? You already created two of the routines for him! Quote Link to comment Share on other sites More sharing options...
BlackBox Posted October 22, 2010 Share Posted October 22, 2010 ... Please post your code when you have all 15,000 of them, will you...!? Quote Link to comment Share on other sites More sharing options...
BlackBox Posted October 22, 2010 Share Posted October 22, 2010 I don't understand how this makes your work any easier. All you're doing is eliminating the need to type "o" to start the offset command. But if this is really what you want, then why don't you just create these lisp routines yourself? You already have the code, all you have to do is change the numbers and save to a separate file. Start with this: (defun c:250() (command "offset" "250" )) Change to this: (defun c:300() (command "offset" "300" )) Save As 300.lsp Now just do that 15,000 more times. You already created two of the routines for him! ... and without tags too, tisk, tisk. Can we get some moderator action?? lol Quote Link to comment Share on other sites More sharing options...
Cad64 Posted October 22, 2010 Share Posted October 22, 2010 Wouldn't that be 14,998 more times? You already created two of the routines for him! Oops, you're right. Damn, see I ended up giving him code. I broke my own rule. Quote Link to comment Share on other sites More sharing options...
Cad64 Posted October 22, 2010 Share Posted October 22, 2010 ... and without tags too, tisk, tisk. Can we get some moderator action?? lol Fixed quote tags. Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2010 Share Posted October 22, 2010 These guys are brutal. Brutal I tell you! Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 22, 2010 Share Posted October 22, 2010 hay i am asked its possible?y u r getting tension?y u r telling we r not teenage girl....plz talk related the topic plz...... Yes, it is possible. You've demonstrated a few yourself. There are plenty of ways to accomplish this - quickly - with LISP, but since you are clearly not receiving the results you continuously and hastily demand, just write them yourself. Hell, if you break the command up in Excel, you could easily have it increment the number and then combine the columns to have what you want. However, I agree with eldon, Remark, etc.; this is such a waste of time and resources. Just type precede typing each number with O and depressing the enter/spacebar/right-click. I said it once before on here and I'll say it again: just because a LISP can be written for something, doesn't mean it should be. Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2010 Share Posted October 22, 2010 "Just because a LISP can be written for something, doesn't mean it should be." I think you just found your new signature. Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 22, 2010 Share Posted October 22, 2010 "Just because a LISP can be written for something, doesn't mean it should be." I think you just found your new signature. Maybe it should be the forum's secondary slogan. Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 22, 2010 Share Posted October 22, 2010 The biggest problem with this idea is clogging up your startup with loading 15,000 LISP routines (in addition to anything else that's being loaded) that will never save you more than a nanosecond. You'll waste more time on startup/loading than you'll save on your new 'cool' macros. Quote Link to comment Share on other sites More sharing options...
jammie Posted October 22, 2010 Share Posted October 22, 2010 The biggest problem with this idea is clogging up your startup with loading 15,000 LISP routines (in addition to anything else that's being loaded) that will never save you more than a nanosecond. You'll waste more time on startup/loading than you'll save on your new 'cool' macros. Thats a fair point. From my earlier post theres no need to define new commands on the fly. As is VVA's post I think its best just to change the offset distance (defun c:endOffset() (if *unknownReactor* (vlr-remove *unknownReactor*)) ) (defun c:beginOffset () (or *unknownReactor* (setq *unknownReactor* (vlr-command-reactor nil '((:vlr-unknownCommand . createOffset))))) (defun createOffset (<rea> <args> / acadDoc cmd offsetDist ) (setq acadDoc (vla-get-activedocument (vlax-get-acad-object )) cmd (car <args>)) (if (and (not (equal (setq offsetDist (atoi cmd)) 0.0 1e-6)) (< 1 offsetDist 15000) ) (progn (setvar 'offsetdist offsetDist) (vla-sendcommand acadDoc (strcat "._offset ")))) ) ) (c:beginOffset) (princ "\nReactor started. Type endOffset to stop") (princ) Quote Link to comment Share on other sites More sharing options...
Guest balajibth84 Posted October 23, 2010 Share Posted October 23, 2010 Thats a fair point. From my earlier post theres no need to define new commands on the fly. As is VVA's post I think its best just to change the offset distance (defun c:endOffset() (if *unknownReactor* (vlr-remove *unknownReactor*)) ) (defun c:beginOffset () (or *unknownReactor* (setq *unknownReactor* (vlr-command-reactor nil '((:vlr-unknownCommand . createOffset))))) (defun createOffset (<rea> <args> / acadDoc cmd offsetDist ) (setq acadDoc (vla-get-activedocument (vlax-get-acad-object )) cmd (car <args>)) (if (and (not (equal (setq offsetDist (atoi cmd)) 0.0 1e-6)) (< 1 offsetDist 15000) ) (progn (setvar 'offsetdist offsetDist) (vla-sendcommand acadDoc (strcat "._offset ")))) ) ) (c:beginOffset) (princ "\nReactor started. Type endOffset to stop") (princ) Hi While i am using this Code error Is Coming.After loading the Code(Command: ; error: no function definition: VLR-COMMAND-REACTOR) Quote Link to comment Share on other sites More sharing options...
The Buzzard Posted October 23, 2010 Share Posted October 23, 2010 Hi While i am using this Code error Is Coming.After loading the Code(Command: ; error: no function definition: VLR-COMMAND-REACTOR) You may be missing (vl-load-com) in the code. Quote Link to comment Share on other sites More sharing options...
jammie Posted October 23, 2010 Share Posted October 23, 2010 (edited) You may be missing (vl-load-com) in the code. Thanks for that (Command: ; error: no function definition: VLR-COMMAND-REACTOR) VLR-COMMAND-REACTOR is part of the Visual Lisp extension of AutoLISP (vlr-command-reactor nil '((:vlr-unknownCommand . createOffset))) This part of the code is what creates a command reactor. As per The Buzzards post you need to add (VL-LOAD-COM) to the top of the code. It loads the ActiveX & Command Reactor support Edited October 23, 2010 by jammie 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.