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

creat a command

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
mtriple1
403 Views, 4 Replies

creat a command

i made a toolbar that has a command like this "_plot 752.3389,680.5393 641.0157,524.6924" a print command.

when i click on the toolbar commands the print windows appear then i click on the option "windows", autcad take the coordinates and print the object , 

 

http://www.youtube.com/watch?v=HzYJVMeHOag&feature=youtu.be

it works..

 

but i have to click on the button "window" when print window appear ..

is there any way to make the command choose a particular button of the print window..

 

thax 

 

 

4 REPLIES 4
Message 2 of 5
Rtogores
in reply to: mtriple1

I believe you should use something more powerful than a menu macro. You can use Visual LISP to set the Layout's PlotType property before you try to plot.

Look for PlotStyle in the ActiveX Reference.

This is a sample program included in the AutoCAD 2013 ActiveX Reference:

(vl-load-com)
(defun c:Example_PlotType()
    ;; This example reads and modifies the PlotType
    ;; Layout value.
    ;; When finished, this example resets the  value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Get the layout object
    (setq ACADLayout (vla-get-ActiveLayout doc))
    
    ;; Read and display the original value
    (setq originalValue (vla-get-PlotType ACADLayout))
    (alert (strcat "The PlotType value is set to: " (itoa originalValue)))

    ;; Modify the PlotType preference by toggling the value
    (vla-put-PlotType ACADLayout acExtents)
    (alert (strcat "The PlotType preference has been set to: " (itoa (vla-get-PlotType ACADLayout))))

    ;; Reset the preference back to its original value
    (vla-put-PlotType ACADLayout originalValue)
    (alert (strcat "The PlotType preference was reset back to: " (itoa originalValue)))
)

 I hope this helps.

 

Message 3 of 5
hmsilva
in reply to: mtriple1

mr-_-small,

put this macro in your button...

 

^C^C-PLOT;Y;;;;;;;W;752.3389,680.5393;641.0157,524.6924;;;;;;;;;;

 

the best way is to write macros is using the command-line version.
of the command you want to use, and see how many enters are needed and the required options...

 

Hope that helps,

 

Henrique

EESignature

Message 4 of 5
mtriple1
in reply to: hmsilva

thank you  fhmsilva .... thiss exactly what im looking for....

 

 

you are awesome and brilliant ..... best answer 

Message 5 of 5
hmsilva
in reply to: mtriple1

You're welcome, mr-_-small

 

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