Author Topic: 2009 Bug with Autolisp custom commands?  (Read 7485 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
2009 Bug with Autolisp custom commands?
« on: April 30, 2008, 03:44:01 PM »
Perhaps someone has seen this before with the AutoCAD interface so I thought I would check.

My custom autolisp routines will only run every other time they are entered.
i.e.
Command: DTD
---runs the routines---
Command:

Command:
DTD Unknown command "DTD".  Press F1 for help.

Command: nil

Just seems odd that they fail every other time invoked? :ugly:

Guest

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #1 on: April 30, 2008, 03:47:17 PM »
Any warnings when you load them?
Any extra ""'s in there?
Any extra/missing parentheseseseseseses??

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: 2009 Bug with Autolisp custom commands?
« Reply #2 on: April 30, 2008, 04:45:12 PM »
Can you post a simple one for us to try?  I've been using 2009 for about a month with no problems . . .

Matt: your avatar is creapy  :-(
James Buzbee
Windows 8

Guest

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #3 on: April 30, 2008, 04:48:25 PM »
Can you post a simple one for us to try?  I've been using 2009 for about a month with no problems . . .

Matt: your avatar is creapy  :-(

Not as creepy as Craig ¶'s!!

daron

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #4 on: April 30, 2008, 05:42:33 PM »
What? It's just the old Powell skateboarding "logo". And I agree, Craig's is creepier. Poor guy and his brother. ha. Wonder's if that is real.

KewlToyZ

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #5 on: April 30, 2008, 05:55:09 PM »
Here are a few examples.
They are just our standard Titles, Notes, dtext & mtext versions using a dimscale setting dialog.

KewlToyZ

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #6 on: April 30, 2008, 05:55:33 PM »
Oops one more file

SomeCallMeDave

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #7 on: May 01, 2008, 07:49:16 AM »
I took a quick peek at DTD.lsp and it appears that the STYLE command in V2009 now has one extra prompt that your routine isn't supplying a value for.


KewlToyZ

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #8 on: May 01, 2008, 11:16:54 AM »
Thanks David, I'll take a look.
I should have caught that.

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: 2009 Bug with Autolisp custom commands?
« Reply #9 on: May 01, 2008, 05:34:38 PM »
Havn't looked at any of the files yet, in depth at least, but why are you messing with dimscale when Annotative Objects are what all the cool kids are doing with 09 these days?
James Buzbee
Windows 8

KewlToyZ

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #10 on: May 01, 2008, 05:51:46 PM »
The old school guys are hard enough to keep within a standard routine of doing things.
I would likely have to manage the whole process for them transparently, they wont understand let alone care.
If annotative & dimscale worked together I wouldn't have to go out of my way relying on dimscale.
Unfortunately with the two completely separate, a complete interface redesign is required including the block libraries.
I just can't see any gains or benefit in the interface time invested.
Its bad enough having to re-write documentation with interface changes every year now.
Not to mention actually trying to make cost effective productivity customizations on my own.
What I have done with the 2009 interface so far in deployment was trim all the fat out.
Nobody cares about the ribbon so I disabled it.
Hiding the pulldowns,
adding all of the standard items to the quick access toolbar,
having the layer manager as a flyout palette,
adding a listing of all our customizations in organized menus available to use the Search menu feature,
quick properties,
Using the ACAD.cui instead of the MEP.cui for the networked implementation.

Everyone that has seen the new interface wants it.
It loads faster and does what they want it to do.
The workspace is considerably cleaner as well.
The only major failure point; aecSelectSimilar.
Major productivity tool. Autodesk needs to put out the code for this feature in Vanilla period.
Works on nearly anything the way 90% of us need it to and better than qselect.
Not to mention so convenient!
I can't get it written in lisp to work anywhere close as well let alone transparently like it does in MEP.

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: 2009 Bug with Autolisp custom commands?
« Reply #11 on: May 03, 2008, 12:54:39 PM »
The following reactor traps the CANNOSCALE command, converts CANNOSCALEVALUE to real world units and then sets DIMSCALE and LTSCALE accordingly.  We make our ltscale half of the dimscale.

Use at your own risk,. Your free to change, hack, edit blah blah blah.  :wink:

Let me know if this helps.  If you havn't used reactors before just cut and past the code into an acaddoc.lsp file.  The reactor will be automatically constructed everytime a document is opened.


Code: [Select]
;;; ;
;;; Command Reactor ;
;;; ;

;;; Call-back Functions ;

;;; Command Ended ;
 (defun jb:ADTCommandEnded(calling-reactor commands / dwg annoscale dimscale ltscale)
    (cond
      ((if (vl-string-search "CANNOSCALE" (getvar "lastprompt"))
(progn
       (setq dwg(vla-get-activedocument(vlax-get-acad-object))
     annoscale(vlax-invoke dwg 'getvariable  "CANNOSCALEVALUE")
     dimscale(/ 12(* annoscale 12.0))
     ltscale(* dimscale 0.5)
     )
       (if ltscale(vlax-invoke dwg "setvariable" "LTSCALE" ltscale))
       
       ;***Warning***
       ;The active dimstyle can't be annotative or the next line will bomb.
       ;You could add code to check if not sure . . ..
       
       (if dimscale(vlax-invoke dwg "setvariable" "DIMSCALE" dimscale))
       (vlax-invoke dwg 'regen  acActiveViewport)
       )))
      )
   )

;;; Construct the Command Reactor ;
(defun jb::ADTConstructCommandReactor  (/)
  (if (= (type *jbADTCommandReactor*) 'VLR-Command-Reactor)
    (progn (vlr-remove *jbADTCommandReactor*) (setq *jbADTCommandReactor* nil)))
  (if (/= (type *jbADTCommandReactor*) 'VLR-Command-Reactor)
    (setq *jbADTCommandReactor*
           (VLR-Command-Reactor
             "jbTools Command Reactor"
             '((:VLR-commandEnded . jb:ADTCommandEnded)
               ))
          ))

  (if (not (vlr-added-p *jbADTCommandReactor*))
    (progn
    (vlr-add *jbADTCommandReactor*)
    (vlr-set-notification *jbADTCommandReactor* 'active-document-only)))
  (princ))


;;; load reactors ;

   
(if jb::ADTConstructCommandReactor
  (jb::ADTConstructCommandReactor))
James Buzbee
Windows 8

KewlToyZ

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #12 on: May 05, 2008, 12:04:24 PM »
Just trying to clarify,
The CANNOSCALEVALUE always came up as read only.
So the reactors let you force it??
If so awesome! I was mumbling obscenities every time I tried working with it. :lmao:

KewlToyZ

  • Guest
Re: 2009 Bug with Autolisp custom commands?
« Reply #13 on: May 05, 2008, 01:19:20 PM »
working with it so far... this was exactly what I was looking for!
Thank you thank you thank you.  :lol:

Just curious, are these command reactors available with syntax highlighting in Visual Studio by chance?

This should be in the "Show Your Stuff" area.
It is a great tool that should have been a feature of the application to begin with!

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: 2009 Bug with Autolisp custom commands?
« Reply #14 on: May 05, 2008, 01:26:21 PM »
Your welcome - glad it worked out.  Just remember if your company does move to Annotative styles the dimscale portion should be commented out.  I like the "Show Your Stuff" idea - will post it soon . . ..

By Visual Studio you mean VBA I think they're called "Events". 
James Buzbee
Windows 8