interesting approach. How do you generate the spreadsheet in the first place? For example if you need to generate a new part, starting with a blank sheet, where does it take its data from?cadcam wrote: ↑Mon Jul 27, 2020 2:58 pmRelatedly I have been looking at trying to simplify the filling in of a template
from a spreadsheet, which inturn is auto filled from defaults, using a Macro. I would like to know if I am
approaching this the correct way or so if someone has already done this, or more probably neater/better way, before?
This would be nice. The first obstacle is that there is no guarantee the field names in template A are the same as the field names in Template B.
Code: Select all
# part1: macro to save values >>> p = App.ActiveDocument.Page >>> t = p.Template >>> fieldDict = t.EditableTexts ## save fieldDict somewhere # change templates ## part2: macro to replace values # retrieve fieldDict from somewhere >>> fieldDict['AUTHOR_NAME'] = 'James Bond' >>> t.EditableTexts = fieldDict
That is true, but if some are not present, nothing is lost except a few bytes unused data. If the behaviour is know, however its easy for people doing their own templates to just use the same names. And I guess, most people who are serious about their models are going to customize the default templates anyway.