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

how to turn into a variable?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
522 Views, 4 Replies

how to turn into a variable?

 

The code below is what i have to select a plotter and paper size, is working fine,

but when transfer to a variable it turn nil....(setq Plotter_name (vla-put-ConfigName plotCfg "Oce TDS750 11th Floor.pc3"))

any suggestion how to acomplish this...?

 

I have the following code to select the plotter and paper size

;; Set the plot device
(vla-put-ConfigName plotCfg "Oce TDS750 11th Floor.pc3")

 

;; Set the paper size
(vla-put-CanonicalMediaName plotCfg "Oce D+ 24x36 in (Landscape)")

4 REPLIES 4
Message 2 of 5
stevor
in reply to: Anonymous

You can 'store' the 2 arguments into a variable:

    (setq ConfigDL (list  plotCfg "Oce TDS750 11th Floor.pc3"))

and then extract the 2 values for something.

 

You can make a function to do each process, ie

 ; Set the plot device

 (defun C:DevNam ()

   (vla-put-ConfigName plotCfg "Oce TDS750 11th Floor.pc3")

   (princ "\n  Set the plot device'd ") (princ) )

 

  ; Set the paper size

  (defun C:PapSiz ()

    (vla-put-CanonicalMediaName plotCfg "Oce D+ 24x36 in (Landscape)")

    (princ "\n  Set the paper size 'd ")  (princ) )


 Probably.

 The existing variable, 'plotcfg,' must have some valid contents, of course.

 And other forms to do the same exist.

 

 

S
Message 3 of 5
dgorsman
in reply to: Anonymous

The function call (vla-put... ) offers some clues about what is happening.  It "puts" (sets) the property - in this case, ConfigName.  If you want the value of that property, you "get" the property using (vla-get...).  This can be done with any vla-object which has properties.  The actual properties vary depending on what the object is ie. a line won't have a plotter configuration name, and some properties are read-only ie. you can "get" but not "put".

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 4 of 5
hmsilva
in reply to: Anonymous


@Anonymous wrote:
The code below is what i have to select a plotter and paper size, is working fine,

but when transfer to a variable it turn nil....(setq Plotter_name (vla-put-ConfigName plotCfg "Oce TDS750 11th Floor.pc3"))

any suggestion how to acomplish this...?



With

(setq Plotter_name (vla-put-ConfigName plotCfg "Oce TDS750 11th Floor.pc3"))

you are setting the variable Plotter_name with the return from the vla-put-ConfigName function, that 'will be nil.

If I understood correctly, you can store the ConfigName in the Plotter_name variable previously

(setq Plotter_name "Oce TDS750 11th Floor.pc3")

and then set the ConfigName with the stored Plotter_name

(vla-put-ConfigName plotCfg Plotter_name)

 

HTH

Henrique

 

EESignature

Message 5 of 5
Anonymous
in reply to: hmsilva

thank you guys: stevor, dgorsman & hmsilva.

 

I got it now with all the sugestions....

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

Post to forums  

Autodesk Design & Make Report

”Boost