Author Topic: Raito vs. equality ( : vs. = ) in -scalelistedit question - I'm getting stupid!  (Read 2048 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
 :ugly:
My stupid question for the month.
I can't for the life of me remember how ranges work.
It's been too long since I had to use them.
In scalelistedit, I'm trying to come up with the ratio that is equal to 1"=1000'
My first instinct for the ratio was 1":1000' but the colon defines a range in math rather than an equality and I am drawing a blank on how to verify my results.
With angles being measured in radians and converted often in lisp I figured it best to ask those with less problematic brain matter than my own who have came across this.
Can ya throw me a bone please?  :lmao:

Here is what I am looking at doing to add a few Engineering scales to work with the canno scale reactor:
Code: [Select]

(command "-scalelistedit" "Reset" "Yes" "Exit")
  (command "-scalelistedit"
  "Add" "1'-0" = 1'-0"" "1:1"
  "Add" "1" = 10'-0"" "1":10'"
  "Add" "1" = 20'-0"" "1":20'"
  "Add" "1" = 30'-0"" "1":30'"
  "Add" "1" = 40'-0"" "1":40'"
  "Add" "1" = 50'-0"" "1":50'"
  "Add" "1" = 60'-0"" "1":60'"
  "Add" "1" = 80'-0"" "1":80'"
  "Add" "1" = 100'-0"" "1":100'"
  "Add" "1" = 200'-0"" "1":200'"
  "Add" "1" = 250'-0"" "1":250'"
  "Add" "1" = 500'-0"" "1":500'"
  "Add" "1" = 1000'-0"" "1":1000'")
  (prompt "\nAnnotation Scales Reset!!!!!!\n")
  (princ)
« Last Edit: August 28, 2008, 04:08:35 PM by KewlToyZ »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Can't use a command in a reactor if that is applicable.

Formatt error, should be
"Add" "1'-0\" = 1'-0\"" "1:1"

Not sure what you are trying to do here.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

KewlToyZ

  • Guest
Thanks I caught the /" when I first ran it, thanks though CAB :D
Actually it works with what I have, the reactor handles it just fine with the use of this system.
Mainly I had to throw something up in front of the user for some routines rather than just the Annotation Scale control at the bottom. Both are doing relatively the same thing now.
I'm just glad I can completely bypass annotative objects with it.
Here is the lisp:
Code: [Select]
(defun c:setscale ()
  (setvar "DIMASZ" 0.125)
  ;==========================================================================================================================================Remove Annotation Scales 
  (command "CANNOSCALE" "1:1")
  (command "PSLTSCALE" 0)
  (command "MSLTSCALE" 0)
  (command "DIMSCALE" 1)
  (command "LTSCALE" 1)
  (command "-scalelistedit" "Reset" "Yes" "Exit")
  (prompt "\nAnnotation Scales Reset!!!!!!\n")
  ;(setq
  (command "-scalelistedit"
  "Add" (princ "1\" = 10'-0\"") (princ "1\":10'")
  "Add" (princ "1\" = 20'-0\"") (princ "1\":20'")
  "Add" (princ "1\" = 30'-0\"") (princ "1\":30'")
  "Add" (princ "1\" = 40'-0\"") (princ "1\":40'")
  "Add" (princ "1\" = 50'-0\"") (princ "1\":50'")
  "Add" (princ "1\" = 60'-0\"") (princ "1\":60'")
  "Add" (princ "1\" = 80'-0\"") (princ "1\":80'")
  "Add" (princ "1\" = 100'-0\"") (princ "1\":100'")
  "Add" (princ "1\" = 200'-0\"") (princ "1\":200'")
  "Add" (princ "1\" = 250'-0\"") (princ "1\":250'")
  "Add" (princ "1\" = 500'-0\"") (princ "1\":500'")
  "Add" (princ "1\" = 1000'-0\"") (princ "1\":1000'")
  "exit")
  (prompt "\nKTA Engineering Scales Added!!!!!!\n")
  (princ)
  ;==========================================================================================================================================

  (if (findfile "setscale.dvb")
    (progn
      (command "-vbaload" (findfile "setscale.dvb"))
      (command "-vbarun" "Module1.SetScale")
      (command "vbaunload" "setscale")
    )
    (princ
      "\nThe file 'SetScale.DVB was not found in your search path."
    )
  )

  (command "style"
   "standard"
   "archquik.shx"
   "0";(* (getvar "dimscale") (/ 3.0 32))
   "1"
   "0"
   "n"
   "n"
  )
);(end)
I went ahead and attached the dvb file with it.

;Reactor from theswamp.com added to the acad2009doc.lsp : (works with acad2008doc as well)
Code: [Select]
;;==============================================================================================
;;; ; Added to check out alternatives to Annotative objects.
;;; ; The DIMSCALE line will need commented out to work with annotative objects.
;;; ; With current KTA interface designs it presents more costs than benefits to invest currently 5-5-2008
;;; 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 1) ;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))
;;==============================================================================================
« Last Edit: August 28, 2008, 05:34:54 PM by KewlToyZ »

KewlToyZ

  • Guest
Reworked for more scales:
Cleans up as much as scalelistedit will allow in its reset after scale is selected.
Added a field for Modeling Scales.

Anyone have a reactor that removes/resets scales whenever a file is saved?