Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

create a new drawing without the displaying prompt entry in the title blocks

Olsndot
Enthusiast

create a new drawing without the displaying prompt entry in the title blocks

Olsndot
Enthusiast
Enthusiast

Hi,

I need help with prompted entry.
I usually enter the prompted entry in the title blocks at the end of drawing creation.
But the prompted entry display at the first, and it is troublesome to close the textbox every time.
Is there a way to skip prompted entry?
Recently I began to study ilogic and macros,but it's difficult for me...

0 Likes
Reply
Accepted solutions (1)
549 Views
4 Replies
Replies (4)

marcin_otręba
Advisor
Advisor
Accepted solution

use:

ThisApplication.SilentOperation = True
Dim drw As DrawingDocument
drw = ThisApplication.Documents.Add(kDrawingDocumentObject, "your template here", True)
ThisApplication.SilentOperation = False

 




Hey, maybe you want to check my apps(click on icon to go to autodesk apps store):


ViewTools      DrawingTools       MRU Folders

0 Likes

Olsndot
Enthusiast
Enthusiast

Thanks marcin, that is exactly what I'm looking for!

 

0 Likes

DeepshipEngineering
Enthusiast
Enthusiast

do you add this code to the default.ivb?

 

This is something I would like to do but am basic with iLogic

0 Likes

WCrihfield
Mentor
Mentor

Hi @DeepshipEngineering.  No.  The "default.ivb" looks like the name of the file where the default Inventor application level VBA project is stored.  The code example above is in iLogic (or vb.net), instead of VBA, but it could easily be converted into VBA, if needed, by adding the keyword 'Set' in front of the third line of code.  That example code will only work when you are creating a new drawing, adding a new sheet, or adding a title block by code, not when doing those things manually.  The 'SilentOperation' setting is essentially blocking all pop-up dialogs while it is set to True, then setting it back to False before the code ends.  This type of setting has 3 levels of scope (amount of stuff it can control):  Application level scope, everything iLogic related level scope, and specific iLogic rule scope.  But all of those are only used when doing things by code, not when doing things manually (through interactive user interface tools).

 

I have attempted to catch and interact with (fill-in, then dismiss) the intermediate dialog that gets shown for filling in prompted entries in a title block that gets shown during the manual process using code based event handlers, but it seemed impossible.  I can catch when the new sheet gets created and can even when a new title block instance gets created, and a reference to the title block on the active sheet after the title block gets created, but can not get a reference to that interactive dialog.  We may be able to catch the event of creating a new instance of a title block 'before' it happens, then take over control of the event (handle it) to block the usual manual process from happening, then use code means to add an instance of a title block, using SilentOperation, but that would require a lot of complex code, and may be really difficult to control properly, due to lack of available information at that point in time.  That sort of thing would normally be dealt with by a custom Inventor add-in though, not just some simple VBA macro, or iLogic rule.

 

However, if you know ahead of time exactly what prompted entries are going to be asked for, and what order they are in, and you already have all the values that you want to put into them, before you create the new drawing, new sheet, or new instance of a title block, then we can do the whole process by code, instead of manually, and can then fill in those prompt values by code, to avoid the dialog prompt.  It usually just requires us to have those values ready, in the form of an Array of Strings, in the correct order, and with the correct number of entries (matching the number of prompts).  Then we can supply that Array of Strings to the procedure for filling in those prompts.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes