Author Topic: Possible to add cannoscale scales with vla?  (Read 2927 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
Possible to add cannoscale scales with vla?
« on: May 08, 2012, 01:47:01 AM »
I was wondering if it is possible to fire the scale list into the drawing with vla instead of:
Code: [Select]
(command "-scalelistedit"
  "Add" (princ "1/128\" = 1'-0\"") (princ ".0078125:12")
  "Add" (princ "1/64\" = 1'-0\"") (princ ".015625:12")
; many more lines to add and pauses for a long period of time
  "exit")

I'm trying to replace my vb program with vlisp and dcl dialogs.
I have the dialog formatted, starting to look at how I am using it to perform the task.


irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Possible to add cannoscale scales with vla?
« Reply #1 on: May 08, 2012, 03:28:32 AM »
Actually I just used dictionaries. See post #78 in this thread: http://forums.augi.com/showthread.php?74324-Scale-List-Nightmares!!

Or see my newest version: http://caddons.svn.sourceforge.net/viewvc/caddons/General/Scales.LSP?revision=65&view=markup

It's incomplete since newer ACads have customizable scale lists. So all you need do now is modify the scale list in registry to your preferences and issue a scale reset. So I gave it up as some useless code.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

KewlToyZ

  • Guest
Re: Possible to add cannoscale scales with vla?
« Reply #2 on: May 08, 2012, 08:35:38 AM »
Thank you Irneb! This should be more than enough to get me through.  :laugh:
I really don't want to add it to the registry either.
I was just remembering how much faster lists can be added using vl to place them into a dwg. I'm just debating on my approach now:
1.) blast all scales in, set the scale from the DCL choice and purge the unused out.
2.) take the choice from the DCL file and add that one scale to the file only

I do need to set multiple factors from the single choice.
CANNOSCALE, DIMSCALE, LTSCALE

But I don't think the standard DCL file will display 3 factors for each single radio button selection.
« Last Edit: May 08, 2012, 08:44:47 AM by KewlToyZ »

KewlToyZ

  • Guest
Re: Possible to add cannoscale scales with vla?
« Reply #3 on: May 08, 2012, 08:52:15 AM »
That does fire the scales into the file quick so it really doesn't matter.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Possible to add cannoscale scales with vla?
« Reply #4 on: May 08, 2012, 10:49:50 AM »
Am i missing something or can't you just do it in options
 
Options->UserPreferences->Default Scale List
 
Or a pic
 

KewlToyZ

  • Guest
Re: Possible to add cannoscale scales with vla?
« Reply #5 on: May 08, 2012, 02:17:42 PM »
Yes you can Jeff.
I was looking for a way to minimize to stock scales, but allow users to create the odd Viewport here and there as required in new layout tabs or complete drawing setups in a universal format. Then purge what isn't in use to the defaults. Plus the cannoscale pick button doesn't get up in peoples face during the viewport setup process. It amazes me how many users are still just not aware of viewport scaling functions and how to properly use paper space. So I make a few routines that spoon feeds them through the process of setup and use.

Plus many users don't know or follow standards, so this enforces them by simplifying their efforts accordingly for LTSCALE, DIMSCALE, DIMASZ ratio's used in block inserts and line formatting. I Still use a reactor in the acad20xxdoc.lsp file for every version from here. It just makes life easier.
http://www.theswamp.org/index.php?topic=24706.msg297909#msg297909
I'm going back and updating this to work as DCL instead of VB.
« Last Edit: May 08, 2012, 02:35:20 PM by KewlToyZ »

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: Possible to add cannoscale scales with vla?
« Reply #6 on: May 08, 2012, 02:43:02 PM »
...I still use a reactor in the acad20xxdoc.lsp file...

Note that the acad20##doc.lsp and acad20##.lsp files are reserved for use by the application, not for personal customisation. Any modifications you make to these files will be overwritten when either the software is upgraded or patched.

You should instead modify either the acaddoc.lsp or acad.lsp files (depending upon whether the expressions are to be evaluated per drawing or per application initialisation respectively - affected by the setting of ACADLSPASDOC, more info here), creating such a files if they don't already exist.

More info here:

The ACADDOC.lsp File
« Last Edit: May 08, 2012, 02:47:31 PM by Lee Mac »

KewlToyZ

  • Guest
Re: Possible to add cannoscale scales with vla?
« Reply #7 on: May 08, 2012, 02:55:38 PM »
Thanks Lee, you gents always keep me on the right track.
I use a customization directory with its own support folder as the default starting location and a standardized profile.
I have been using the stock acad20##doc.lsp from each version and simply adding a few settings and the reactor in a bundle at the end of the file. Each version had its quirks so it let me keep the usage history for each version more or less. I'll read up on the ACADDOC.lsp maybe I can just do the alternative items using version detection like this:
Code: [Select]
;============================== AutoCAD 2007 =====================================
; ACADVER = "17.0s (LMS Tech)"
;(if (= (vlax-product-key) "Software\\Autodesk\\AutoCAD\\R17.0\\ACAD-5001:409")
(if (= (getvar "ACADVER") "17.0s (LMS Tech)")
(c:SetSCL7)
(princ)
) ;End If


; ACADVER = "17.1s (LMS Tech)"
;============================== AutoCAD MEP 2008 =================================
; ACADVER = "17.2s (LMS Tech)"
;(if (= (vlax-product-key) "Software\\Autodesk\\AutoCAD\\R17.2\\ACAD-7006:409")
(if (= (getvar "ACADVER") "17.1s (LMS Tech)")
(c:SetSCL9)
(princ)
) ;End If

;============================== AutoCAD MEP 2009 =================================
; ACADVER = "17.2s (LMS Tech)"
;(if (= (vlax-product-key) "Software\\Autodesk\\AutoCAD\\R17.2\\ACAD-7006:409")
(if (= (getvar "ACADVER") "17.2s (LMS Tech)")
(c:SetSCL9)
(princ)
) ;End If

;============================== AutoCAD MEP Acad 2010 =================================
; ACADVER = "18.0s (LMS Tech)"
;(if (= (vlax-product-key) "Software\\Autodesk\\AutoCAD\\R17.2\\ACAD-7006:409")
(if (= (getvar "ACADVER") "18.0s (LMS Tech)")
(c:SetSCL9)
(princ)
) ;End If

;============================== AutoCAD MEP 2011 =================================
; ACADVER = "18.1s (LMS Tech)"
;(if (= (vlax-product-key) "Software\\Autodesk\\AutoCAD\\R17.2\\ACAD-7006:409")
(if (= (getvar "ACADVER") "18.1s (LMS Tech)")
(c:SetSCL9)
(princ)
) ;End If

;============================== AutoCAD MEP 2012 =================================
; ACADVER = "18.2s (LMS Tech)"
;(if (= (vlax-product-key) "Software\\Autodesk\\AutoCAD\\R18.2\\ACAD-7006:409")
(if (= (getvar "ACADVER") "18.2s (LMS Tech)")
(c:SetSCL9)
(princ)
) ;End If

;============================== AutoCAD MEP 2013 =================================
; ACADVER = "19.0s (LMS Tech)"
;(if (= (vlax-product-key) "Software\\Autodesk\\AutoCAD\\R18.2\\ACAD-7006:409")
(if (= (getvar "ACADVER") "19.0s (LMS Tech)")

(c:SetSCL13)
;(princ "/n    2013 Interface Used !!!")
(princ)
) ;End If

I load all of my custom routines with an Enterprise.cuix & Enterprise.mnl file.
The reactor and a few setenv variables are all i place in the acad20##doc.lsp
« Last Edit: May 08, 2012, 03:00:10 PM by KewlToyZ »

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: Possible to add cannoscale scales with vla?
« Reply #8 on: May 08, 2012, 03:01:52 PM »
Here are a couple of other methods where version / software detection is concerned:

Code: [Select]
(setq app (vlax-get-acad-object))

(vla-get-caption app) ;; Returns the text on the application title bar

(vla-get-name app)    ;; Returns the name of the application

(vla-get-version app) ;; Returns the version of the application (same as ACADVER)