Hi all,
I'm looking to write a few simple little macros to look after simple drawing updates (replace borders & title blocks, move sketched symbols etc), so I'm looking for some good reference material to help me around the API... I can write the code in VBA easy enough, but it doesn't seem to translate to iLogic all that well. For example, DrawingDocument.BorderDefinitions.Copyto exists in VBA, but doesn't appear to exist in iLogic. Where can I find out what does and doesn't exist in iLogic?
I was hoping to use iLogic, as an exercise in learning something new, otherwise I might end up going back to VBA.
Any help would be greatly appreciated.
Hi -
The iLogic functions, etc. are documented as part of the Inventor help.
There are "functions", such as ThisDoc, which can serve as a bridge to the regular Inventor API.
Jeff
Hi Jeff,
I found the help files you mention, and it seems there's more to it then I first realised. I had just been looking in the wrong location.
Having said that, I'm trying to update our titleblocks and borders on older drawings with those on our current drawing template. I've figured out how to add a NEW title block (one with a different name). However, I can't figure out how to replace a title block of the same name. Can I rename the existing one, then add the new one? If so, how do I rename and delete a title block?
Thanks and Regards
Gerrard,
If you want to update your older drawings automatically, I would recommend doing it with a VBA or VB.NET program. iLogic could do it, but it won't really give you any advantage. The main use of iLogic is to add rules to documents, and have these rules run on parameter changes or other events. What you're doing sounds like a one-time (or occasional) operation.
If you want more info on replacing title blocks, I would recommend creating a new post specifically on that subject.
I think you might have to delete the existing title block and definition, copy the new definition in, and then re-create the title block.
Gerrard,
Have you tried the Drawing Resource Transfer Wizard? If might do what you want. If it does, then you don't need a custom program.
MjDeck,
Thanks for the reply, Updating the title block was just an example (perhaps not the best) to demonstrate the kind of thing we'd like to achieve. iLogic may not be the best option for these tasks, of that I'm aware. The plan is to assess iLogic, and determine whether there's any advantages (i.e. simplicity) to using iLogic over VBA or VB.NET...
All I'm looking for is a good reference source I can read through to check out the capabilities.
Good point though regarding the iLogic remaining local in a document. Not much point writing code to update title blocks, if you have to add that code into old drawings. I think VBA/.NET wins on that one...
Drawing Resource Transfer Wizard looks good, but it's not consistent with our work flow... We need our title blocks to be updated at a particular point in our drawings life cycle.
Cheers
Gerhick, i recently wrote some code that does what you are trying to do in VBA. Im not at my machine just now but could paste the code once im back at work if you'd be interested?