Guest balajibth84 Posted October 21, 2010 Share Posted October 21, 2010 (edited) Hai i am using the Code for simple offset....Now want to offset "10"means i have code.But each number i want means i am pasting that code and editing that...Plz see the Below.. (defun c:10() (command "offset" "10" )) (defun c:75() (command "offset" "75" )) (defun c:250() (command "offset" "250" )) So Simply i want to Give 1 to 15000 numeric to this offset code.so how to insert that range here?plz help... Edited January 30, 2012 by SLW210 Code Tags!!!! Quote Link to comment Share on other sites More sharing options...
Guest balajibth84 Posted October 22, 2010 Share Posted October 22, 2010 hai i am waiting for reply.anybody seen this??? Quote Link to comment Share on other sites More sharing options...
Cad64 Posted October 22, 2010 Share Posted October 22, 2010 Please don't post questions in other people's threads. If you have a question, start your own thread, and please post it in the correct area of the forum. I have moved this question to the AutoLISP forum. Quote Link to comment Share on other sites More sharing options...
VVA Posted October 22, 2010 Share Posted October 22, 2010 So? (defun C:AddOff ( / str dist) (initget 7) (setq dist (getint "\nType offset dist: ")) (setvar "OFFSETDIST" dist) (setq dist (itoa dist) str (strcat "(defun C:" dist "()(command \"_.OFFSET\" \"\"))")) (eval(read str)) (alert (strcat "\nCommand " dist " added. Type " dist " in command line")) (princ) ) Quote Link to comment Share on other sites More sharing options...
eldon Posted October 22, 2010 Share Posted October 22, 2010 This seems to be an exceptional useless lisp. You are disabling your ability to enter numbers for direct entry, because every time you enter a number, you will go into Offset. Is it really too much trouble to enter "o" and then type the distance Quote Link to comment Share on other sites More sharing options...
jammie Posted October 22, 2010 Share Posted October 22, 2010 (edited) Well this is my attempt. I would prefer to call offset from the command line but who am I to question.... To start type beginOffset If you enter a number between 1 & 10000 offset should start automatically (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 10000) ) (progn (setq newCommand (strcat "(defun c:" cmd "()(command \"._OFFSET\" "cmd "))")) (vla-sendcommand acadDoc (strcat newCommand " "cmd " ")))) ) ) To remove type endOffset (defun c:endOffset() (if *unknownReactor* (vlr-remove *unknownReactor*)) ) Edited October 22, 2010 by jammie command name end changed Quote Link to comment Share on other sites More sharing options...
autolisp Posted October 22, 2010 Share Posted October 22, 2010 dear sir nice code thx Quote Link to comment Share on other sites More sharing options...
ReMark Posted October 22, 2010 Share Posted October 22, 2010 I sometimes wonder about the requests made for code. I understand about wanting to make our jobs easier and faster but really, the time some of you gain is then wasted standing around the water cooler talking about last night's big game. LOL Quote Link to comment Share on other sites More sharing options...
BlackBox Posted October 22, 2010 Share Posted October 22, 2010 Given the frequency with which the OP demands full routines , I'm amazed that members are still giving the OP code. Admittedly, (in this case) the OP has finally 'requested help' instead. It's about !@#% time. Quote Link to comment Share on other sites More sharing options...
Cad64 Posted October 22, 2010 Share Posted October 22, 2010 Given the frequency with which the OP demands full routines , I'm amazed that members are still giving the OP code. Well, as long as he keeps getting the fish for free, he will never learn to fish for himself. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted October 22, 2010 Share Posted October 22, 2010 Well, as long as he keeps getting the fish for free, he will never learn to fish for himself. ... Then, perhaps you'll appreciate post #'s 1-6? :wink: http://www.cadtutor.net/forum/showthread.php?53558-How-to-Find-out-Scaled-Entity Quote Link to comment Share on other sites More sharing options...
Cad64 Posted October 22, 2010 Share Posted October 22, 2010 Yes, that's more like it. Judging by the number of requests he has made in the last few weeks, he obviously needs to learn how to write code for himself. So just giving him finished programs is not really helping him. Although I've seen his other threads where you guys have tried to teach him but he just keeps coming back asking for the finished program. So, maybe he doesn't want to learn how to fish? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 22, 2010 Share Posted October 22, 2010 Although I've seen his other threads where you guys have tried to teach him but he just keeps coming back asking for the finished program. So, maybe he doesn't want to learn how to fish? Case in point. http://www.cadtutor.net/forum/showthread.php?53280-How-to-Create-Lisp-Dialog-Box Quote Link to comment Share on other sites More sharing options...
BlackBox Posted October 22, 2010 Share Posted October 22, 2010 To boot... he's been asked/told/shown how to use tags[/b] God knows how many times, and still refuses to use them. Quote Link to comment Share on other sites More sharing options...
Guest balajibth84 Posted October 22, 2010 Share Posted October 22, 2010 ... Then, perhaps you'll appreciate post #'s 1-6? :wink: http://www.cadtutor.net/forum/showthread.php?53558-How-to-Find-out-Scaled-Entity Y u r wrongly thinking??? Quote Link to comment Share on other sites More sharing options...
BlackBox Posted October 22, 2010 Share Posted October 22, 2010 Y u r wrongly thinking??? Huh!? Quote Link to comment Share on other sites More sharing options...
Guest balajibth84 Posted October 22, 2010 Share Posted October 22, 2010 (edited) Hai its very useful.Suppose i am using this code with one dwg ...and after i am loading this code to new dwg means once againg i want to give all values.... (defun c:75() (command "offset" "75" )) (defun c:250() (command "offset" "250" )) So i am asking i am giving first time 5 or 10 means its should be offset..no need i st time giving means its saved that value..its affect the flow.........so plz fix 1 to 15000.....then we will use usly..is it possible????? Edited January 30, 2012 by SLW210 Code Tags. Quote Link to comment Share on other sites More sharing options...
eldon Posted October 22, 2010 Share Posted October 22, 2010 Y u r wrongly Why can you not write your words in full It would almost enable people to read your demands Quote Link to comment Share on other sites More sharing options...
lpseifert Posted October 22, 2010 Share Posted October 22, 2010 Why can you not write your words in full Ditto... we're not teenage girls here Also, what is 'Hai'? I've got to agree with eldon in post #5... it's a useless lisp. Just enter "O" for the offset command and enter the offset distance. Quote Link to comment Share on other sites More sharing options...
Lee Mac 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 Ditto... we're not teenage girls hereAlso, what is 'Hai'? Reminds me of this thread: http://www.cadtutor.net/forum/showthread.php?36734-Than-Then 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.