automation command

automation command

sHubamyadav016
Enthusiast Enthusiast
500 Views
3 Replies
Message 1 of 4

automation command

sHubamyadav016
Enthusiast
Enthusiast

 

I am working with two custom AutoCAD commands: (c:htry) and (c:fabpdf). While both commands function correctly when invoked individually, automating the input for (c:fabpdf) presents a challenge. Specifically, after executing (c:fabpdf), the command prompts for the height of the PDF, and you're unable to programmatically supply this value within your AutoLISP routine.

MY current AutoLISP function is as follows:

 

(defun c:genretae()
(c:htry)
(setq pdf_height 2400)
(c:fabpdf)
(v1-cmdf "")
(command (itoa pdf_height))
(princ)
)

 

In this function, after setting pdf_height to 2400, you call (c:fabpdf), which then prompts for the height. The subsequent (command (itoa pdf_height)) is intended to supply this value, but it doesn't work as expected because the prompt within (c:fabpdf) is likely using functions like getint or getreal, which pause execution and wait for user input, and do not accept input from the (command) function.

 

 

 

0 Likes
501 Views
3 Replies
Replies (3)
Message 2 of 4

paullimapa
Mentor
Mentor

See if this works 

(defun c:genretae()
(c:htry)
(vla-sendcommand (vla-get-activedocument(vlax-get-acad-object)) "fabpdf 2400\r"))
(princ)
)

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 4

sHubamyadav016
Enthusiast
Enthusiast

like i have lot of values in my excel related to height so can i generate multiple component  can you help me writing this code using excel only height is there

0 Likes
Message 4 of 4

paullimapa
Mentor
Mentor

This sounds like a different topic then your OP.

You should start a new post describing clearly exactly what you need and provide the needed examples like the excel and the dwg files so others here can jump in and assist.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes