Author Topic: Simple question (indefinite points)  (Read 11667 times)

0 Members and 2 Guests are viewing this topic.

Notsober

  • Guest
Re: Simple question (indefinite points)
« Reply #15 on: October 18, 2007, 04:59:19 PM »
Quick & dirty...with the caveats that layer CLOUD must exist, and I left out the ortho part. Mainly because I like polar so much better, and I couldn't figure out how to turn it off with a variable.

Code: [Select]
;;Revcloud from spline
(defun C:RS (/ user_layer user_os)
  (setvar user_layer (getvar "clayer"))
    (setvar "clayer" "CLOUD")
  (setvar user_os (getvar "osmode"))
    (setvar "osmode" 0)
  (command "_.spline")
  (while (> (getvar "CmdActive") 0)
    (command pause)
  )
  (command "_.revcloud" "o" "l" "n")
  (setvar "clayer" user_layer)
  (setvar "osmode" user_os)
  (princ)
)

I think M-dub is trying to teach you how to fish. (See the "About this Forum" sticky.) :wink:

However, I am learning to fish myself, so this is practice for me. We'll make you write the next one yourself. :-D

Command: rs
; error: bad argument type: (or stringp symbolp): nil


I have no idea what this means... but I could take a stab at it.

it's a PICNIC = problem in chair, not in computer  :-o

LE

  • Guest
Re: Simple question (indefinite points)
« Reply #16 on: October 18, 2007, 05:01:55 PM »
make sure the layer exist, first.... before using setvar "clayer"

Notsober

  • Guest
Re: Simple question (indefinite points)
« Reply #17 on: October 18, 2007, 05:02:47 PM »
it does exist.

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Simple question (indefinite points)
« Reply #18 on: October 18, 2007, 05:06:11 PM »
T.Willey,

Funny you should use a `>' type of check; have you every had any problems with that? The reason I ask is because ive always just checked for a regular command, something like:
Code: [Select]
(eq (logand (getvar "CMDACTIVE") 1) 1)
have you every used this type of process in a transparent command before? Now you have me thinking about this? I think I might have to run an experiment or two.

Kate,
You might want to think about accounting for an error or two.
QUICK HINTS:
1. Have a look around for my osnap `toggle'  procedure.
2. Be carefull with that (setvar 'clayer ...process.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

LE

  • Guest
Re: Simple question (indefinite points)
« Reply #19 on: October 18, 2007, 05:06:46 PM »
:)

Rename:

(setvar user_layer (getvar "clayer"))

To:

(setq user_layer (getvar "clayer"))


and...

(setvar user_os (getvar "osmode"))

to

(setq user_os (getvar "osmode"))
« Last Edit: October 18, 2007, 05:09:07 PM by LE »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Simple question (indefinite points)
« Reply #20 on: October 18, 2007, 05:10:51 PM »
T.Willey,

Funny you should use a `>' type of check; have you every had any problems with that? The reason I ask is because ive always just checked for a regular command, something like:
Code: [Select]
(eq (logand (getvar "CMDACTIVE") 1) 1)
have you every used this type of process in a transparent command before? Now you have me thinking about this? I think I might have to run an experiment or two.

Kate,
You might want to think about accounting for an error or two.
QUICK HINTS:
1. Have a look around for my osnap `toggle'  procedure.
2. Be carefull with that (setvar 'clayer ...process.

I have seen other code posted like that John, but my math isn't what is used to be, and I understand the '>' way better.   :-)  As much as I can recall, I have never had a problem with using it this way.  I can check my personal code and see if I have any in there like that, and try and remember if that piece of code as ever error'ed from me.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Simple question (indefinite points)
« Reply #21 on: October 18, 2007, 05:18:25 PM »
I have seen other code posted like that John, but my math isn't what is used to be, and I understand the '>' way better.   :-)  As much as I can recall, I have never had a problem with using it this way.  I can check my personal code and see if I have any in there like that, and try and remember if that piece of code as ever error'ed from me.

*lol* cool. It was just that your test got me thinking about its use in a transparent command (vlax-add-cmd).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Notsober

  • Guest
Re: Simple question (indefinite points)
« Reply #22 on: October 18, 2007, 05:26:02 PM »
great. now my acad won't open!

BTW- I put the lsp in the startup, so that tells me I have to change something. Just before, I did this:

Replaced
(setvar user_layer (getvar "clayer"))

to:

(setq user_layer (getvar "clayer"))


and...

(setvar user_os (getvar "osmode"))

to

(setq user_os (getvar "osmode"))

So now how do I get my ACAD back up and running?

Josh Nieman

  • Guest
Re: Simple question (indefinite points)
« Reply #23 on: October 18, 2007, 05:30:03 PM »
Whatever you did.... UNdo it.

I highly recommend that whenever you go and edit a file of such importance as the acad startup routines, that you create a backup.  Just copy the original (after you fix it, of course) and rename it to acad.lsp.bak or something like that... I usually keep the original name and file extension, and just add a .bak to the end...

This way if you really bork something up and don't know why... you can just recopy the backup over the borked file.

Notsober

  • Guest
Re: Simple question (indefinite points)
« Reply #24 on: October 18, 2007, 05:36:03 PM »
well, I did save the orginal *working* lisp routine. So I wrote over the corrupted one, and still nothing. My ACAD will not open now. I could get into a lot of trouble with my office manager if she finds out what I did!

Please help, I promise I won't bork anything up again!!

Josh Nieman

  • Guest
Re: Simple question (indefinite points)
« Reply #25 on: October 18, 2007, 05:40:20 PM »
What's the last thing you did before it stopped working?

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Simple question (indefinite points)
« Reply #26 on: October 18, 2007, 05:40:32 PM »
What do you mean your acad wont start?

BTW, did you edit this file in MS Word?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Simple question (indefinite points)
« Reply #27 on: October 18, 2007, 05:40:53 PM »
Nothing in the routine should have ruined your Acad.  This is just a simple routine to speedup some button pushing.

Standard IT response.... Did you try rebooting?? ... Crazy thing is.. it works most of the time.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Josh Nieman

  • Guest
Re: Simple question (indefinite points)
« Reply #28 on: October 18, 2007, 05:41:56 PM »
Also, specifically what 'doesnt work' ?

Does nothing happen when you double click the startup icon, or select it from the start menu or whatever method you use?

Does the application open and report an error?  If so, what does the error say, specifically?

Notsober

  • Guest
Re: Simple question (indefinite points)
« Reply #29 on: October 18, 2007, 05:47:16 PM »
Okay, just before it quit opening, I changed the strings like LE suggested. And so, since the lisp routine was already in startup suite, I simply restarted ACAD (clicked icon, AND clicked on a dwg). Or tried to at least...

It simply stops at regen... and hangs. I eventually have to hit Ctrl+Alt+Delete to end application, then window pops up stating that AutoCad stopped responding.

I'll be back shortly, gonna reboot computer.