Jump to content

Offset Lisp


Guest balajibth84

Recommended Posts

Why can you not write your words in full :cry:

 

It would almost enable people to read your demands :shock:

 

 

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.

Link to comment
Share on other sites

  • Replies 46
  • Created
  • Last Reply

Top Posters In This Topic

  • BlackBox

    7

  • ReMark

    6

  • Cad64

    6

  • jammie

    5

Top Posters In This Topic

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?

Link to comment
Share on other sites

Guest balajibth84

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....

Link to comment
Share on other sites

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?"

Link to comment
Share on other sites

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. :lol:

Link to comment
Share on other sites

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. :lol:

 

You already created two of the routines for him!:lol:

 

... and without

 tags too, tisk, tisk. Can we get some moderator action?? lol :P
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

"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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

Guest balajibth84
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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by jammie
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...