Jump to content
hosannabizarre

Import page setup information automatically

Recommended Posts

hosannabizarre

Currently I use a lisp file to import page setup information, which brings

in previously configured plot set up information (as found in a specified drawing template).

 

page_setups.lsp...

 

 
(DEFUN C:PSN () (command "._-PSETUPIN" "W:/Library/Acad Setup/Page_Setup_Template/page_setup_template.dwg" "*"))

 

 

Although I have "page_setups.lsp" identified in my startup suite of

applications to load, I still have to type "PSN" to import page setup info.

 

Typing these three letters is tiring my fingers out.

 

Can I build the import instruction into accaddoc.lsp so that

I don't have to keep typing PSN, so that it autoloads (and imports)

with every session / drawing??

 

Cheeeeeeeeeers,

 

hosannabizarre

Share this post


Link to post
Share on other sites
Tharwat

Yes , Actually this is the way of lots of experts in programing.

 

Try it ...... although I haven't tried it before

 

Regards,

 

Tharwat

Share this post


Link to post
Share on other sites
hosannabizarre

Thanks tharwat313

 

The thing is, I'm not sure where to put it in the existing code.

 

My accaddoc.lsp is as follows:

 

 
;;;*-*TXT acad.lsp is loaded once, acaddoc.lsp is loaded for each
;;;       document, s::startup in any case is called after acaddoc.lsp
;;;       has been loaded
;
;;(if (= nil acad_helpdlg)
;; (progn
;;    (load "acadr15.lsp")
;;    (load (strcat (getvar "menuname") ".mnl"))
;;  )
;
(if (= nil genlade)
 (progn
   (princ (load "gen/acadm.lsp" "\nError: acadm.lsp not loaded!"))
   (if acadmappend (setq s::startup (acadmappend s::startup)))
 )
)

 

 

Can someone please identify where, in the above code, I would locate the instruction to import the page setups from my template?

 

i.e Where would I put this...

 

(command "._-PSETUPIN" "W:/Library/Acad Setup/Page_Setup_Template/page_setup_template.dwg" "*")

 

 

I tried adding it to the end but it didn't seem to work.

 

Thanks

Share this post


Link to post
Share on other sites
Pablo Ferral

You can put it anywhere, as lon as it's outside a DEFUN statement autocad will parse it.

 

I'm not sure that that meathod would be great technique though!

Share this post


Link to post
Share on other sites
hosannabizarre

I have realised that the method outlined here is better.

 

i.e. make a button which invokes a lisp like this:

 

(defun c:plot40 nil
(vl-load-com)
(command "_.-plot" "yes" "" "\\\\Kwifs1\\KWIN_40" "A3" "Millimeters" "LANDSCAPE" "NO" "Extents" "FIT" "CENTER" "YES" "KWIN40.ctb" "YES" "W" "NO" "NO" "yes" )
(princ)
)

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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