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: 

(VBA) Write multiple Prompted Entry Fields in one pass?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mslosar
535 Views, 2 Replies

(VBA) Write multiple Prompted Entry Fields in one pass?

Is it possible to write multiple prompted entry fields down in a single pass? As it is now, you can see the taskbar reporting as it writes down each line.

 

Essentially i've got 6 different fields i'm trying to write down using code like shown below:

 

If oTB.GetResultText(oTitleBox1) <> Me.Title1.Value Then
    Call ThisApplication.ActiveDocument.ActiveSheet.TitleBlock.SetPromptResultText(oTitleBox1, Title1.Value)
End If

If oTB.GetResultText(oTitleBox2) <> Me.Title2.Value Then
    Call oTB.SetPromptResultText(oTitleBox2, Title2.Value)
End If

 Just wondering if there's a way it can be written down in a single pass to save time or if it's a limitation of prompted entry text.

2 REPLIES 2
Message 2 of 3
ekinsb
in reply to: mslosar

It's not currently possible to set mulitple prompted entry fields in a single call.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 3
mslosar
in reply to: ekinsb

That's what I thought - thanks 🙂

 

Keep it in mind for future builds though. People use lots of prompted fields and a single write operation would be nice.

 

 

FWIW, i ran into an odd situation with this yesterday.

 

The macro i'm writing basically looks at an idw and indexes the drawing information (title lines, drawing number, revision, etc) for all sheets in the idw. Each sheet is displayed in a dialog box in it's own individual tab. I went to sheet 2 in the idw and ran the macro. In the dialog I went to the sheet 2 tab to edit the info. Made changes, hit apply, everything worked fine. While still in the dialog, i went to sheet 3's tab and made changes. When i hit apply it instantly finished. There was no delay at all. It was so quick i thought it did nothing. I exited the dialog and then manually went to sheet 3 and looked at the titleblock. No changes. Seemed like it didn't work. However, i went to the browser and clicked 'edit field info' under the titleblock and lo and behold all the changes were in there. Problem was, clicking OK didn't update the sheet - neither did hitting update sheets on the manage tab. Nothing would make the info from the field text dialog update to the sheet.

 

My solution was to go back into the 'Apply' code and add a .update event to the drawing. Upon running the macro the write delay where you could see the taskbar making each write operation ran regardless of what sheet i was on (which is what i'd have expected).

 

That's kind of a long winded explanation to ask - is it the update operation what causes the delay on the prompted text and not the actual assigning of the information? Assigning the info seemed to be instant, but to get it to display in the titleblock seemed to require separate individual operations per field. Is that a fair understanding?

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

Post to forums  

Autodesk Design & Make Report