Kenny Leung Posted September 25, 2023 Posted September 25, 2023 I am trying to store some data of the AutoCAD drawing into clipboard for other paste use using command/lisp. (vlax-invoke(vlax-get (vlax-get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipBoardData) 'setData "TEXT" "test") When I run the command above, It is successful to store the data into clipboard when it run in Local Machine, and the administrator account in Virtual Machine, with code -1 However when I run the command under user account in Virtual Machine, it is fail with code 0 Any idea to solve? Thanks Quote
Steven P Posted September 25, 2023 Posted September 25, 2023 I use these, subtle difference in the code with (setq htmlfile.... but not sure if that will work for you - I don't use a virtual machine. Also a good tip from MHUPP was to release the html file after use. (defun SetClipBoardText ( MyText / htmlfile ) (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'setData "Text" Mytext) (vlax-release-object htmlfile) (princ) ) (defun GetClipBoardText ( / htmlfile MyText ) (setq result (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'getData "Text")) (vlax-release-object htmlfile) MyText ) Quote
dan20047 Posted September 25, 2023 Posted September 25, 2023 Isn't the whole point of a VM to completely isolate the VM from computer running it? I assume there are ways to have shared file access, but any operating system access like clipboard would need to be worked out through the VM, not AutoCAD. (Just my assumptions, have not tested a VM in years.) However if file acces is possible, you could code to write clipboard to a text file that could be read between Local & Admin VM. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.