Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Plotter name by program control

15 REPLIES 15
Reply
Message 1 of 16
george.drayton
669 Views, 15 Replies

Plotter name by program control

Has anyone a technique that can check the current plotter name for the current tab and assign it to a variable?  i.e. can it be assigned to a variable to check if if equals "myplotter1".  The next step  - is there a technique to change the plotter name to "myplotter2.pc3".

I have partially done the latter part of this in the past using the -plot command line to ASSIGN a  new plotter but I would really like to only run the routine if it really needs to.  Thanks for any help.

Tags (1)
15 REPLIES 15
Message 2 of 16
hmsilva
in reply to: george.drayton


@Anonymous wrote:

Has anyone a technique that can check the current plotter name for the current tab and assign it to a variable?  i.e. can it be assigned to a variable to check if if equals "myplotter1".  The next step  - is there a technique to change the plotter name to "myplotter2.pc3".

I have partially done the latter part of this in the past using the -plot command line to ASSIGN a  new plotter but I would really like to only run the routine if it really needs to.  Thanks for any help.


Try

(setq AObj (vlax-get-Acad-Object)
      ADoc (vla-get-ActiveDocument AObj)
      ALyt (vla-get-ActiveLayout ADoc)
      Plt  (vla-get-Configname ALyt)
);; setq
(if (= "myplotter1" Plt)
  (vla-Put-Configname ALyt "myplotter2.pc3")
  );; if

 

HTH

Henrique

EESignature

Message 3 of 16

Thanks for your help once again :).   The section of code (vlax-get-Configname ALyt) does not work - it produces and error.  I have loaded (vl-load-com).

 

I cannot find the documentation for vla-get functions (or any vla stuff in fact) in the help system - can you point me int he right direction please. Thanks

Message 4 of 16
hmsilva
in reply to: george.drayton


@Anonymous wrote:

Thanks for your help once again :).   The section of code (vlax-get-Configname ALyt) does not work - it produces and error.  I have loaded (vl-load-com).

 

I cannot find the documentation for vla-get functions (or any vla stuff in fact) in the help system - can you point me int he right direction please. Thanks


You're welcome, George.

 

(vlax-get-Configname ALyt) is (vla-get-Configname ALyt) and should work...

 

For the ActiveX Help, try at the VLIDE help, at the ActiveX & VBA Reference... online

 

 

HTH

Henrique

 

 

 

EESignature

Message 5 of 16
hmsilva
in reply to: george.drayton

George,

maybe this way it will be easier to understand,

 

(defun c:test (/ ACADDOCUMENT ACADOBJECT ACTIVELAYT ACTIVEPLT)
  (vl-load-com)
  (setq AcadObject (vlax-get-acad-object))
  (setq AcadDocument (vlax-get-property AcadObject 'ActiveDocument))
  (setq ActiveLayt (vlax-get-property AcadDocument 'ActiveLayout))
  (setq ActivePlt (vlax-get-property ActiveLayt 'Configname))
  (if (= "myplotter1" ActivePlt)
    (vlax-put-property ActiveLayt 'Configname "myplotter2.pc3")
  );; if
  (princ)
)

 Henrique

EESignature

Message 6 of 16

Hi again,

 

I"m back on my project  - but it still doesn't work for me - the error show below

 

Command: TEST
; error: ActiveX Server returned an error: Error loading type library/DLL

Message 7 of 16
hmsilva
in reply to: george.drayton


george.drayton wrote:


; error: ActiveX Server returned an error: Error loading type library/DLL



Hi George,

 

try to copy/paste

(vl-load-com)

to your command line, what is the message that you receive?

AutoCAD version?

 

Henrique

 

EESignature

Message 8 of 16
george.drayton
in reply to: hmsilva

I ran your Test routine which included (vl-load-com) and got the error message   Thanks H

Message 9 of 16

oops A2014

Message 10 of 16
hmsilva
in reply to: george.drayton

MAC version?

EESignature

Message 11 of 16
george.drayton
in reply to: hmsilva

windows 7 32 bit

Message 12 of 16
hmsilva
in reply to: george.drayton

George,

when I asked for copy/paste (vl-load-com), It was just to make sure that the error occurred when trying to load the ActiveX support functions.

I never had that error. but making a "Google", several people solved that issue with a repair, or a reinstall...
Maybe someone else has a better solution, let's wait and see...

Henrique

EESignature

Message 13 of 16
george.drayton
in reply to: hmsilva

windows V7

Message 14 of 16
hmsilva
in reply to: george.drayton


@Anonymous wrote:

windows V7


???

Did you solve it?

EESignature

Message 15 of 16
george.drayton
in reply to: hmsilva

hi H,

I reinstalled and now when I run the line   (setq ActivePlt (vlax-get-property ActiveLayt 'Configname)) it returns the existing plotter name and no error messages.  thanks for the idea!!  rgds

 

George

Message 16 of 16
hmsilva
in reply to: george.drayton

You're welcome, George
Glad you got a solution.

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost