iLogic "copy to buffer code"

iLogic "copy to buffer code"

Anonymous
Not applicable
2,567 Views
9 Replies
Message 1 of 10

iLogic "copy to buffer code"

Anonymous
Not applicable

Hi,

 

I`m not sure if this is possible or not.

Is there any way to write a script which copy`s a variable to the buffer? Similar to CTRL-C?

 

Thanks,

0 Likes
Accepted solutions (2)
2,568 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
Accepted solution

Hi achmidt,

 

Anything youj can do in VB.NET you can pretty much do in iLogic.

In VB.NET the clipboard object gives you full access to the windows clipboard.

 

To use the clipboard in iLogic you need to import the System.Windows.Forms NameSpace.

Once you do that you can simply set text or  on the clipboard object.

---

 

Imports System.Windows.Forms

 

Sub Main

  Dim greeting as string = "Hello World!"

  Clipboard.SetText(greeting)

End sub

Message 3 of 10

Anonymous
Not applicable

Thanks,

 

For some reason, when I run the rule it says:

 

Error on Line 3 : Statement is not valid in a namespace.

 

Any thoughts?

 

Thanks!

0 Likes
Message 4 of 10

Anonymous
Not applicable

do you have all the Windows Dot.NET Frameworks installed on your PC?

 

How about the FREE VB.NET 2010 Express programming environment from Microsoft.

 

0 Likes
Message 5 of 10

Anonymous
Not applicable

Yep, I have VB express 2010 installed and Framework 4.

0 Likes
Message 6 of 10

Anonymous
Not applicable

What version of Inventor are you running?

0 Likes
Message 7 of 10

Anonymous
Not applicable

2012 Prof.

0 Likes
Message 8 of 10

Anonymous
Not applicable
Accepted solution

Not sure then.

 

Did you cut an paste the text from my above post and paste it into your iLogic file?

 

I've had problems with this forum's messageboard adding hidden characters to the clipboard.

 

When in doubt I copy and paste into notepad.  Scan for unwanted characters visually then paste it into the iLogic editor.

or

You could manually type in the code displayed.

 

The snippet works for me.

 

0 Likes
Message 9 of 10

Anonymous
Not applicable

oh boy, I thought when you use vb.net code you have to check the box Straight VB code. Thats what I did and it didn`t work. When I did uncheck the box - everything worked!!! WTH...

 

Thanks!

0 Likes
Message 10 of 10

Anonymous
Not applicable

Gruff,

the Clipboard works great with iLogic, thank you for the answer on how to use it.

 

Imports System.Windows.Forms

 

Sub Main

  Dim greeting as string = "Hello World!"

  Clipboard.SetText(greeting)

End sub

 

0 Likes