iLogic/Code To Open the "Edit Field Text" Dialog Box native to inventor

iLogic/Code To Open the "Edit Field Text" Dialog Box native to inventor

MechMachineMan
Advisor Advisor
4,138 Views
9 Replies
Message 1 of 10

iLogic/Code To Open the "Edit Field Text" Dialog Box native to inventor

MechMachineMan
Advisor
Advisor

Is there a way to access the Edit Field Text Dialog Box for various components such as the title block or sketch symbols?

 

The way inventor has it laid out is very nice, so what my code will do is open it up automatically for each page within a drawing document so that the data can be editted easier than having to navigate the browser on every page to accomplish the same thing.

 

Is there a specific API to allow us to bring this up, or is it only accessible (if even possible) through a clumsy navigation of the browser nodes using code?

 

 

If not, would there be another easy way to bring up a dialog box that has multiple lines for multiple prompted entry blocks? 

*I'm guessing using forms would work, but how would I use temporary variables to be input into the form??*

 

Thanks again.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Accepted solutions (1)
4,139 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable

I've used forms to do this except instead of "prompted" on my template I assigned the template to use predetermined "custom", then wrote a rule that triggers so the form pops up.  When creating the form make sure the custom properties exist and then you can just drag them into the form creator from the iProperties tab.

 

input.JPG

0 Likes
Message 3 of 10

MechMachineMan
Advisor
Advisor
Accepted solution

Thanks for the input!

 

As it turns out, that method doesn't work for us as we use multiple sheets per idw.

 

However, I found out how to accomplish what I originally wanted;

 

I just had to iterate through sheets, select the titleblock and then run the EditFieldTextCmd Control definition and it did what I wanted.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 4 of 10

Anonymous
Not applicable

I'm going to have to try that thanks!

0 Likes
Message 5 of 10

Anonymous
Not applicable

Would you be willing to share how you are able to run EditFieldTextCmd, I'm unable to get it to run.  I have used the CommandManager to run DrawingArragneDimensionsCmd but I must be missing something on this one.  Thank you.

Message 6 of 10

MechMachineMan
Advisor
Advisor
The name of the command might not be exactly that... but you need to have
the title block selected before you run it

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 7 of 10

Josh_Hunt
Advocate
Advocate

@MechMachineMan or @Anonymous Can you guide me to the precise syntax for how to activate the "EditFieldTextCmd" or whatever it actually is? thank you

 

How do I programatically select the title block. I am only concerned with the ACTIVE TB.

 

I have attempted the below code in iLogic but I'm having difficulty finding it since iLogic doesn't have intellisense.

 

ThisApplication.ActiveDocument.ActiveSheet.TitleBlock.EditFieldTextCmd

If you are interested, I actually started with this so it would prompt me for the "SHT_TTL_L1" and "SHT_TTL_L2" prompted entries. However I have a few title blocks with different prompted entries so I think it's more reliable to use the "EditFieldTextCmd".

 

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oTB As Inventor.TitleBlock = oDoc.ActiveSheet.TitleBlock
'Exit if Active Sheet does not have a Title Block
If oTB Is Nothing Then Exit Sub

Dim oTextBox As TextBox
Dim oTextBoxes As TextBoxes = oTB.Definition.Sketch.TextBoxes

For Each oTextBox In oTextBoxes
	'Pull existing value from prompt entry.
	sData = oTB.GetResultText(oTextBox)
	If oTextBox.text = "SHT_TTL_L1" Then
		'Prompt for new value
		SHT_TTL_L1 = InputBox(oTextBox.text, oTextBox.text, sData)
		'Reuse existing value if InputBox was canceled
		'NOTE: THIS WILL NOT ALLOW YOU TO ENTER DELETE AN EXISTING VALUE.
		If SHT_TTL_L1 = "" Then SHT_TTL_L1 = sData
		
	ElseIf oTextBox.text = "SHT_TTL_L2" Then
		SHT_TTL_L2 = InputBox(oTextBox.text, oTextBox.text, sData)
		If SHT_TTL_L2 = "" Then SHT_TTL_L2 = sData
		
	End If
Next
'Use existing Title Block and push prompted Entries
ActiveSheet.SetTitleBlock(oTB.Name, SHT_TTL_L1, SHT_TTL_L2)

 

Josh Hunt
0 Likes
Message 8 of 10

MechMachineMan
Advisor
Advisor

Here is what you need to read into:

 

http://modthemachine.typepad.com/my_weblog/2009/03/running-commands-using-the-api.html


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 9 of 10

Josh_Hunt
Advocate
Advocate
Enter a body
Josh Hunt
0 Likes
Message 10 of 10

maxim.teleguz
Advocate
Advocate

The command is actually: DrawingEditFieldTextCmd

0 Likes