Ronan,

Thanks for taking time to explain what you're after. Here is an ugly way of
achieving what you're trying to do. If you know AutoLisp/VisualLisp, this would
be quite easy to follow. I'm not aware that there is a COM/ActiveX function
equivalent to the ssgetfirst function. HTH.

import comtypes.client
app = comtypes.client.GetActiveObject("AutoCAD.Application")
doc = app.ActiveDocument

#This assumes user has picked/selected ONE object to measure
cmd1 = '(setq enamePicked (ssname (cadr (ssgetfirst)) 0)) '
doc.SendCommand(cmd1)

#Start the MEASURE command. Add the rest of the command as you wish.
cmd2 = '(command "MEASURE" enamePicked) '
doc.SendCommand(cmd2)

#clean the variable after done with the MEASUREMENT command
cmd3 = '(setq enamePicked nil) '
doc.SendCommand(cmd3)




------------------------------------------------------------------------------
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to