New Native PDF Export not registering seperator or delimiter

New Native PDF Export not registering seperator or delimiter

FrankHolidaytoiling
Advocate Advocate
465 Views
2 Replies
Message 1 of 3

New Native PDF Export not registering seperator or delimiter

FrankHolidaytoiling
Advocate
Advocate

this works well, it does seem to exception sometimes i think if the file exists and i hope there is a simple way round that. My real issue here is for some strange reason the seperator is not included...i am hoping to achive this... Drawing Number[2]  What i currently get is this Drawing Number2

 

 

 

            List<TableCellCombinedParameterData> namingRule = new List<TableCellCombinedParameterData>();
            TableCellCombinedParameterData sheetNumberData = TableCellCombinedParameterData.Create();
            sheetNumberData.CategoryId = new ElementId(BuiltInCategory.OST_Sheets);
            sheetNumberData.ParamId = sheetNumberParam.Id;
            namingRule.Add(sheetNumberData);

            TableCellCombinedParameterData bracketOpen = TableCellCombinedParameterData.Create();
            bracketOpen.Separator = "[";
            namingRule.Add(bracketOpen);

            TableCellCombinedParameterData revisionData = TableCellCombinedParameterData.Create();
            revisionData.CategoryId = new ElementId(BuiltInCategory.OST_Sheets);
            revisionData.ParamId = revisionParam.Id;
            namingRule.Add(revisionData);

            TableCellCombinedParameterData bracketClose = TableCellCombinedParameterData.Create();
            bracketClose.Separator = "]";
            namingRule.Add(bracketClose);

            if (namingRule.Count > 0)
            {
                pdfOptions.SetNamingRule(namingRule);
            }

 

 

 

0 Likes
Accepted solutions (1)
466 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni
Accepted solution

Maybe you need to escape that special bracket character somehow?

  

The Separator property has a getter and a setter. What does the getter return after you use the setter?

  

Have you tried specifying a prefix and a suffix instead?

   

Here are some other basic suggestions from the Gemini AI: 

  

  

Maybe it can dive in deeper for you if you ask it to.

   

Please let us know how you end up solving this. Thank you!

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3

FrankHolidaytoiling
Advocate
Advocate

Thanx Jerremy, your idea using the getter and using the prefix and suffix certainly helped, Gemini did not,  the LLM kept trying to convince me that i was to use the single pdf export method. However I had an idea that maybe setting the RevisionData directly using the cell using the prefix and suffix would change the celldata and it works. However I am not sure if Revit users will accept the CurrentRevision text appended. it will be seen as onerous to them as soemthing to remove or that which maybe accidently will be left on the sheet number. I may have to post process and remove all isntances of that. 

            TableCellCombinedParameterData revisionData = TableCellCombinedParameterData.Create();
            revisionData.Prefix = "[";
            revisionData.Suffix = "]";

            revisionData.CategoryId = new ElementId(BuiltInCategory.OST_Sheets);
            revisionData.ParamId = revisionParam.Id;
            namingRule.Add(revisionData);

 

0 Likes