Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Access Application Options through iLogic

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
mehatfie
1618 Views, 5 Replies

Access Application Options through iLogic

Hello All,

 

I am new to iLogic and trying to access the "Application Options" under the "Tools" tab. I am trying to grab some information from a couple of fields but it seems that I don't have the right coding or Snippets that indicate how I would do so.

 

Please point me in the right direction of a helpful source or if anybody knows how to code this.

 

Thanks in Advance

Mitch

5 REPLIES 5
Message 2 of 6

Hi mhatfield,

 

Here is a quick example of an iLogic rule that works with Application Options. If you look up SketchOptions or GeneralOptions, etc in the API reference, you'll find a listing of all of the properties available. Or reply back with the specific properties you're wanting to change.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

'get Application Options > General Tab > User Name
myName = ThisApplication.GeneralOptions.UserName
MessageBox.Show(myName, "Title")

'set Application Options > General Tab > 3D Indicatior
if ThisApplication.GeneralOptions.Show3DIndicator = True Then
ThisApplication.GeneralOptions.Show3DIndicator = False
Else if ThisApplication.GeneralOptions.Show3DIndicator = False Then
ThisApplication.GeneralOptions.Show3DIndicator = True
Else
End if

'get current Application Options > General Tab > Select Other Delay
myDelay  = ThisApplication.GeneralOptions.SelectOtherDelay
'set Application Options > General Tab > Select Other Delay
myDelay = InputBox("Enter a new Select Other Delay", "iLogic", myDelay)
ThisApplication.GeneralOptions.SelectOtherDelay = myDelay

'set current Application Options > Sketch Tab > Display Grid Lines
if ThisApplication.SketchOptions.DisplayGridLines = True Then
ThisApplication.SketchOptions.DisplayGridLines = False
Else if ThisApplication.SketchOptions.DisplayGridLines = False Then
ThisApplication.SketchOptions.DisplayGridLines = True
Else
End if

'Update All
iLogicVb.UpdateWhenDone = True

'Display the Application Options Dialog Box
ThisApplication.CommandManager.ControlDefinitions.Item("AppApplicationOptionsCmd").Execute

 

Message 3 of 6

Hi Curtis,

 

Thank you very much for your assistance as just seeing the "walk through" as to how the code works will definitely help me moving forward.

 

Is there a possibility you'd be able to help me with my other issue?

http://forums.autodesk.com/t5/Autodesk-Inventor/Trigger-Custom-Add-Ins-Button-through-iLogic/td-p/33...

 

Again, Thank you for all your help

Mitch

 

Message 4 of 6
Arnsteinh
in reply to: mehatfie

Is it possible to change the color scheme and bacground color with ilogic roles? Does anybody knows how to code this?

 

Arnstein

Message 5 of 6

 Curtis,

I am attempting to adapt the code you supplied to change the inactive component opacity in the display options (see below), but keep getting the error "Public member 'InactivePartsDisplayOpaquePercentage' on type 'DisplayOptions' not found." I'm assuming that InactivePartsDisplayOpaquePercentage is the incorrect name for this option, however this is how it is refered to in the applicaiton opiton .xml file. I have tried other names for opaque percentage but can't seem to get it right. Can you tell me what I am doing wrong?

 

Thanks,

Travis

 

'get current Application Options > Options Tab > Component Opacity
myOpacity = ThisApplication.DisplayOptions.InactivePartsDisplayOpaquePercentage 'set Application Options >Options Tab > Component Opacity
myOpacity = InputBox("Enter a new Select Other Delay", "iLogic", myOpacity) ThisApplication.DisplayOptions.InactivePartsDisplayOpaquePercentage = myOpacity 'Update AlliLogic
Vb
.UpdateWhenDone = True 'Display the Application Options Dialog Box
ThisApplication.CommandManager.ControlDefinitions.Item("AppApplicationOptionsCmd").Execute

 

Message 6 of 6

Hi irvinet1264,

 

I think this is what you're after, or at least should point you in the right direction. If you look up ShadedDisplayOptions in the API help, you'll find all of the properties for the ShadedDisplayOptions Interface.

 

 

Dim oShadeOptions As ShadedDisplayOptions
oShadeOptions = ThisApplication.DisplayOptions.ShadedDisplayOptions

'get current Application Options > Display Tab > Shaded Display Options
Dim myOpacity As Long
myOpacity  = oShadeOptions.ShadeOpacityForEnabledComponents
‘ensure this option is selected
oShadeOptions.ShadedEnabledComponents = True
'set Application Options > Display Tab > Shaded Display Options
myOpacity = InputBox("Enter a new shaded display percentage", "iLogic", myOpacity)
oShadeOptions.ShadeOpacityForEnabledComponents = myOpacity

'Display the Application Options Dialog Box
ThisApplication.CommandManager.ControlDefinitions.Item("AppApplicationOptionsCmd").Execute

 

How to access the API Help files (just in case it helps someone):

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

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

Post to forums  

Autodesk Design & Make Report