Issue with AddTitleBlock Method

Issue with AddTitleBlock Method

Anonymous
Not applicable
419 Views
3 Replies
Message 1 of 4

Issue with AddTitleBlock Method

Anonymous
Not applicable

Hello, 

 

I'm working updating my company's title block editing macro. One of the requested improvements is to add rev lines as needed instead of being limited to what is included at design time (originally 7 lines with 4 textboxes). I've developed a process to do this, however when there is more than 7 lines the AddTitleBlock method throws "Invalid procedure call or argument"

 

However the macro still creates the title block with the expected number of lines and it can be added manually. 

 

Is there a reason for this? at lower number of rev lines my code works just fine.

 

Thanks

0 Likes
420 Views
3 Replies
Replies (3)
Message 2 of 4

MechMachineMan
Advisor
Advisor

Why are you using rev lines in your titleblock!?!?!?!?!

 

Inventor ships with a native revision block functionality that blows any "hard coded" thing out of the water. It even allows you to hide hidden lines.

 

Please look into using this instead or provide a good reason for using it in the titleblock.

 

People/companies who use this program against how it's made are part of the reason I don't sleep at night.


--------------------------------------
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 3 of 4

Anonymous
Not applicable

MechMachineMan -  Thanks for your response.

 

I'm sure the revision block that is built in to inventor is great, however I am not the one who decides the format I only work with in it. I did look at it briefly but it doesn't look like it'll fit our format, which if we changed would require us to update 1,000+ drawings. The tools provided by software developers are powerful but are not always the solution that is needed.

 

If you have any insights into why the AddTitleBlock Method is failing I'd love to hear them, because even if I did implement your suggestion this may come up in another situation. 

 

Thanks!

0 Likes
Message 4 of 4

MechMachineMan
Advisor
Advisor

You do understand you can change the layout, the columns called off, and the widths of the native inventor titleblock, so unless you are doing something super whacky with the borders of the table, you can almost certainly make it fit your scenario.

 

As far as the API call: Could just be a limitation of the functionality as the titleblocks were never designed to be used in that way. Which is why they provided tables and the native rev table.

 

You make swapping over drawings to a new revision style seem terrible. It's not. Unless you change styles, font, layers, line thicknesses of every object and want to force those to be changed over too. Or if you have a ton of different variations of the same titleblock that has the same text fields labelled differently. 

 

Otherwise it's as simple as 

 

For Each Doc in SomeDocList
   Cycle through tb def fields/ prompted entry fields
       Save values in an array
   Copy New TB Def from source doc to target doc

   For Each sheet 
       Delete old tb
       Place new tb
       Place new rev table
       Cycle through saveArray
           Populate fields in new rev table
    Next sheet
Next doc

 

"An ounce of prevention is worth a pound of cure."


--------------------------------------
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