Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
george.drayton
Posts: 93
Registered: ‎06-11-2007
Message 1 of 16 (387 Views)

Plotter name by program control

387 Views, 15 Replies
09-03-2013 04:31 PM

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.

*Expert Elite*
hmsilva
Posts: 2,648
Registered: ‎12-17-2004
Message 2 of 16 (362 Views)

Re: Plotter name by program control

09-04-2013 01:20 AM in reply to: george.drayton

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

Valued Contributor
george.drayton
Posts: 93
Registered: ‎06-11-2007
Message 3 of 16 (338 Views)

Re: Plotter name by program control

09-05-2013 02:39 PM in reply to: george.drayton

Thanks for your help once again :smileyhappy:.   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

*Expert Elite*
hmsilva
Posts: 2,648
Registered: ‎12-17-2004
Message 4 of 16 (333 Views)

Re: Plotter name by program control

09-05-2013 03:02 PM in reply to: george.drayton

george.drayton wrote:

Thanks for your help once again :smileyhappy:.   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

 

 

 

*Expert Elite*
hmsilva
Posts: 2,648
Registered: ‎12-17-2004
Message 5 of 16 (325 Views)

Re: Plotter name by program control

09-05-2013 03:56 PM 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

Valued Contributor
george.drayton
Posts: 93
Registered: ‎06-11-2007
Message 6 of 16 (300 Views)

Re: Plotter name by program control

09-09-2013 10:10 PM in reply to: george.drayton

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

*Expert Elite*
hmsilva
Posts: 2,648
Registered: ‎12-17-2004
Message 7 of 16 (291 Views)

Re: Plotter name by program control

09-10-2013 01:02 AM 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

 

Valued Contributor
george.drayton
Posts: 93
Registered: ‎06-11-2007
Message 8 of 16 (285 Views)

Re: Plotter name by program control

09-10-2013 01:13 AM in reply to: hmsilva

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

Valued Contributor
george.drayton
Posts: 93
Registered: ‎06-11-2007
Message 9 of 16 (282 Views)

Re: Plotter name by program control

09-10-2013 01:14 AM in reply to: george.drayton

oops A2014

*Expert Elite*
hmsilva
Posts: 2,648
Registered: ‎12-17-2004
Message 10 of 16 (281 Views)

Re: Plotter name by program control

09-10-2013 01:15 AM in reply to: george.drayton

MAC version?

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community