Inventor Customization

Reply
Distinguished Contributor
achmidt
Posts: 130
Registered: ‎07-21-2011
Message 1 of 10 (421 Views)
Accepted Solution

iLogic "copy to buffer code"

421 Views, 9 Replies
09-26-2011 10:56 AM

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
Valued Mentor
Gruff
Posts: 431
Registered: ‎11-24-2003
Message 2 of 10 (413 Views)

Re: iLogic "copy to buffer code"

09-26-2011 02:25 PM 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

Distinguished Contributor
achmidt
Posts: 130
Registered: ‎07-21-2011
Message 3 of 10 (365 Views)

Re: iLogic "copy to buffer code"

04-06-2012 09:53 AM 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
Valued Mentor
Gruff
Posts: 431
Registered: ‎11-24-2003
Message 4 of 10 (362 Views)

Re: iLogic "copy to buffer code"

04-06-2012 10:02 AM 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.

 

Distinguished Contributor
achmidt
Posts: 130
Registered: ‎07-21-2011
Message 5 of 10 (357 Views)

Re: iLogic "copy to buffer code"

04-06-2012 11:28 AM 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
Valued Mentor
Gruff
Posts: 431
Registered: ‎11-24-2003
Message 6 of 10 (353 Views)

Re: iLogic "copy to buffer code"

04-06-2012 12:20 PM in reply to: achmidt

What version of Inventor are you running?

Distinguished Contributor
achmidt
Posts: 130
Registered: ‎07-21-2011
Message 7 of 10 (351 Views)

Re: iLogic "copy to buffer code"

04-06-2012 12:22 PM 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
Valued Mentor
Gruff
Posts: 431
Registered: ‎11-24-2003
Message 8 of 10 (349 Views)

Re: iLogic "copy to buffer code"

04-06-2012 12:29 PM 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.

 

Distinguished Contributor
achmidt
Posts: 130
Registered: ‎07-21-2011
Message 9 of 10 (346 Views)

Re: iLogic "copy to buffer code"

04-06-2012 12:53 PM 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
Active Member
Standing1
Posts: 9
Registered: ‎01-13-2009
Message 10 of 10 (186 Views)

Re: iLogic "copy to buffer code"

08-19-2013 10:39 AM 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

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube