Copy objects to clickboard

Copy objects to clickboard

Hubert_Los
Advocate Advocate
574 Views
3 Replies
Message 1 of 4

Copy objects to clickboard

Hubert_Los
Advocate
Advocate

Hello,

How can I copy the selected objects to the clickboard. For example, I selected 2 sketchedsymbols and I would like to copy them using code. Then paste them into another location. I don't see any cmd command that does this. I only found information about copying text, but that doesn't work in this case.

0 Likes
Accepted solutions (1)
575 Views
3 Replies
Replies (3)
Message 2 of 4

FINET_Laurent
Advisor
Advisor

Hello @Hubert_Los,

 

What are you refering to when talking about "another location" ?


I would peronally get all object in the document select set, exclude all that is not a sketched symbol, & for each symbols I would get their definition. Lastly I would allow the user to click a point on the drawing sheet & add the new symbols.

 

Kind regards,

FINET L. 

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

Message 3 of 4

WCrihfield
Mentor
Mentor
Accepted solution

I agree with @FINET_Laurent that this process can be more complicated than it might seem sometimes, depending on what type of data or object is being copied / pasted, and what the current situation is like.  Previous selections need to be cleared, wanted objects need to be selected, then copied, then they need to be unselected, then some navigation is often needed, then some sort of user interface interaction, or change in 'system focus' needs to happen, to indicate where the data/object will be pasted.

But below are a couple tips to help along the way:

ThisApplication.CommandManager.ControlDefinitions.Item("AppCopyCmd").Execute
ThisApplication.CommandManager.ControlDefinitions.Item("AppPasteCmd").Execute

https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.clipboard?view=windowsdesktop-8.0 

In an iLogic rule, we can often just directly type in "Clipboard" (without the quotes), then type the dot (.) after it, to see all its properties & methods that are available to us.  Using that directly on things other than text though, can be more complicated than using the Inventor commands.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 4

Hubert_Los
Advocate
Advocate

@WCrihfield 

"then they need to be unselected" this was very important. It works, thank you.

0 Likes