ab00 Posted July 10 Posted July 10 (edited) Hi, I have some code where I want to copy an item to clipboard with base point, and paste into another drawing with insertion point. I have all my code working except the copy with base point section. The below code allows me to initialise the COPYBASE command but requires user input for the base point position: sourceDoc.SendCommand "_SELECT All" & vbCr & vbCr sourceDoc.SendCommand "_copybase" & vbCr I can't seem to find a way to code the base point into the command. I have tried the below code: sourceDoc.SendCommand "_copybase" & " , " & basePoint(0) & " , " & basePoint(1) & " , " & basePoint(2) & vbCr I have the paste command working with an insertion point but the COPYBASE command must work a different way. destinationDoc.SendCommand "_pasteclip " & insertionPoint(0) & " , " & insertionPoint(1) & " , " & insertionPoint(2) & vbCr If anyone could help this would be greatly appreciated. Edited July 10 by SLW210 Added Code Tags! Quote
SLW210 Posted July 10 Posted July 10 In the future please use Code Tags for your code. (<> in the editor toolbar) Quote
BIGAL Posted July 10 Posted July 10 If you look at using LISP rather than VBA there are lots of examples about using OBDX to do this task. This question was asked within a week either here or at Autodesk/forum. Quote
ab00 Posted July 11 Author Posted July 11 Can it be done in VBA though? If not then I'll look into LISP but I have a large code in VBA and this is the only part I cannot get working. Instead of having the user select the basepoint on screen after the COPYBASE command is initialised, I want a basepoint in my VBA code to be used the same way 'PASTECLIP' accepts the insertion point I have entered. Quote
ab00 Posted July 11 Author Posted July 11 UPDATE I found the solution... sourceDoc.SendCommand "_copybase" & vbCr & basePoint(0) & "," & basePoint(1) & "," & basePoint(2) & vbCr Instead of... sourceDoc.SendCommand "_copybase" & basePoint(0) & "," & basePoint(1) & "," & basePoint(2) & vbCr 'vbCr' was required after initialising the command and before the base point coordinates are entered. 1 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.