How to use extrim by pyautocad?

How to use extrim by pyautocad?

01131042
Explorer Explorer
355 Views
3 Replies
Message 1 of 4

How to use extrim by pyautocad?

01131042
Explorer
Explorer

I wanted to use extrim command by this sample of code:

command = "extrim "
doc.SendCommand(command)

Then, user have to pick a polygon by hand. I want to provide there an object predefined in code. Is there an option to pass an object into command instead of picking manually? 


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

john.uhden
Mentor
Mentor

@01131042 ,

This area of the forum is for Autolisp/Visual Lisp customization.

Your snippet doesn't look like Autolisp.

If it were Autolisp you could use the vlax-add-cmd function to make an AutoCad command of it without having to modify the code, e.g.

(defun tires ( / #)

  (setq # (getint "\nHow many tires are on the vehicle?:  "))

  (princ (strcat "\nThere are " (itoa #) " tires on the vehicle."))

  (princ)

)

(vlax-add-cmd "tires" 'tires)

which allows you to feed the # from the command line, e.g.

(command "tires" 4)

 

John F. Uhden

0 Likes
Message 3 of 4

Sea-Haven
Mentor
Mentor

Have a look inside Extrim.lsp and you will see a defun (Etrim, so if you (load "Extrim") you can call the use of it by (Etrim ent pt), hopefully you understand.

0 Likes
Message 4 of 4

daniel_cadext
Advisor
Advisor

AutoLISP and General Customization forum

Lisp doesn’t have a SendCommand? (vla-sendcommand)

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
0 Likes