ViewPlan.Duplicate incorrect when TransactionMode is automatic

Anonymous

ViewPlan.Duplicate incorrect when TransactionMode is automatic

Anonymous
Not applicable

I am having issues with ViewPlan.Duplicate(ViewDuplicateOption.AsDependent) when i have the TransactionMode set to automatic in my ExternalCommand.

 

The problem is that some parameters are not inherited / duplicated correctly for the first duplicated viewtemplate. When i change the transactionmode to manual and do the transactions manually. Everything is duplicated as expected.

 

The parameters that are incorrect only in the FIRST duplicated view are:

 - View Scale

 - Scale value

 

 

And some others... which i dont seem to remember.

 

So what i do.

 

- Create a ViewPlan

- Apply a Tempalte to the created Viewplan

- In a loop Duplicate the ViewPlan, as param give: ViewDuplicateOption.AsDependent, duplicate it a N times.

- Check the first Dependent ViewPlan, and compare it to the ViewPlan we depend on, and compare it to the other Dependant ViewPlans.

- The first Dependend ViewPlan has incorrect parameters.

 

The fix for now is, set the TransactionMode to Manuall.

 

(additonal question: is there a Revit SDK / Api issue tracker?)

0 Likes
Reply
Accepted solutions (1)
615 Views
3 Replies
Replies (3)

augusto.goncalves
Alumni
Alumni
Thanks for reporting it, I'll escalate

About the "tracker", unfortunately there is no such a tool... sorry
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes

arnostlobel
Alumni
Alumni
Accepted solution

Augusto will report the problem as a bug. However, please keep in mind that using manual transaction mode should be your only approach going forward - it should not be just a workaround for your current problem. The automatic transaction mode is very troublesome and probably causes more problems than it tries to solve. It is really there just for back-ward compatibility. We will phase it out of Revit eventually. I cannot advise strongly enough against using the automatic transaction mode.

 

Thank you

Arnošt Löbel

crthomas
Contributor
Contributor

It is still possible to have the same problem with TransactionMode set to Manual, if your transactions are not started and stopped correctly.

I have found that when I wrap the entire process (create parent view, loop through creating dependent views, etc) in one transaction, that I too have the first dependent view with improper scale, discipline, etc. But, if I make the creation of each dependent view a separate transaction, then the view properties are correct.

 

0 Likes