Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic "copy to buffer code"

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
achmidt
2016 Views, 9 Replies

iLogic "copy to buffer code"

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,

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
9 REPLIES 9
Message 2 of 10
Gruff
in reply to: achmidt

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
achmidt
in reply to: achmidt

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!

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
Message 4 of 10
Gruff
in reply to: achmidt

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.

 

Message 5 of 10
achmidt
in reply to: Gruff

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

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
Message 6 of 10
Gruff
in reply to: achmidt

What version of Inventor are you running?

Message 7 of 10
achmidt
in reply to: Gruff

2012 Prof.

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
Message 8 of 10
Gruff
in reply to: achmidt

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.

 

Message 9 of 10
achmidt
in reply to: Gruff

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!

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
Message 10 of 10
Standing1
in reply to: Gruff

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

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report