Assign value in the Clipboard to variable in the rule

Assign value in the Clipboard to variable in the rule

RoyWickrama_RWEI
Advisor Advisor
482 Views
1 Reply
Message 1 of 2

Assign value in the Clipboard to variable in the rule

RoyWickrama_RWEI
Advisor
Advisor

The Sample - 2 below is from this forum. Thanks, I use it usually.

 

Recently, I feel like doing with the reverse; i.e. to assign the Textual or Numerical data in the clipboard to a variable in the code: (to eliminate using Ctrl + V - paste manually).

 

Sample - 1 (Need help to assign clipboard value)

Imports System.Windows.Forms
Sub Main
  Dim Len_Max As Double
  Len_Max = Value_Clipboard		'To assgn clipboard value (numerical) to the variable
  Dim oMfgr As String
  oMfgr = Value_Clipboard		'To assgn clipboard value (string) to the variable
  End Sub

 

 

Sample - 2 (OK)

Imports System.Windows.Forms
 
Sub Main
  Dim PartNo As String = iProperties.Value("Project", "Part Number")
  Dim Revision As String = iProperties.Value("Project", "Revision Number")
  Dim Description As String = iProperties.Value("Project", "Description")
  'Clipboard.SetText(PartNo)
  'Clipboard.SetText(Revision)
  Clipboard.SetText(Description)
End Sub

 

I appreciate if someone help.

Thanks.

 

 

0 Likes
Accepted solutions (1)
483 Views
1 Reply
Reply (1)
Message 2 of 2

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@RoyWickrama_RWEI,

 

Try below iLogic code to assign value from clipboard.

Imports System.Windows.Forms
Sub Main() Dim Len_Max As Double Len_Max = Convert.ToDouble(Clipboard.GetText) 'To assgn clipboard value (numerical) to the variable Dim oMfgr As String oMfgr = Clipboard.GetText 'To assgn clipboard value (string) to the variable End Sub

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network