Part of a graph I’m working on requires the duplication of the 3D view, I’ve been following using the following post Call View to Open as the basis for my graph by I’m encountering an error I can’t seem to resolve.
Python script…
> #Copyright 2016. All rights reserved. Bimorph Consultancy LTD, 5 St Johns Lane, London EC1M 4BH www.bimorph.co.uk
> #Written by Thomas Mahon @Thomas__Mahon info@bimorph.co.uk Package: bimorphNodes
> #GitHub: https://github.com/ThomasMahon/bimorphNodes/
> #Follow: facebook.com/bimorphBIM | linkedin.com/company/bimorph-bim | @bimorphBIM
>
> import clr
>
> clr.AddReference(“RevitServices”)
> import RevitServices
> from RevitServices.Persistence import DocumentManager
> from RevitServices.Transactions import TransactionManager
>
> clr.AddReference(“RevitAPI”)
> import Autodesk
> from Autodesk.Revit.DB import *
>
> doc = DocumentManager.Instance.CurrentDBDocument
> uidoc = DocumentManager.Instance.CurrentUIDocument
>
> TransactionManager.Instance.EnsureInTransaction(doc)
> TransactionManager.Instance.ForceCloseTransaction()
>
> view = UnwrapElement(IN[0])
> uidoc.RequestViewChange( view )
Any input would be grateful
TIA.
Regards
Eddie
@EddieSaez can you format your code and post an image of the python script?
The python script is in the post…
Unsure about formatting it for the post
My guess is that it might be in the header part, a new line was made outside of the comment. Can you take a screenshot on the inside of your python script, as shown in dynamo?
1 Like
@EddieSaez it looks good to me. Post your dyn (or a link) please
Dyn file as requested… BTW thanks for assisting me with this.
DuplicateView.dyn (22.4 KB)
1 Like
The python node is working for me in Dynamo 2.0 with Revit 2018. Sorry, can’t find what’s wrong. Try recreating the python node maybe?
1 Like
revit version? Dynamo Version?
Interesting… I’m Revit 2019 with Dynamo 2.0
Wonder if that’s the issue
It works with Revit 2019 and Dynamo 2.02 but just with one view.
I think you are providing a list. Let me see if I get the same error with a list
kennyb6
January 25, 2019, 1:41am
13
I get a different error if using a list as input, the ‘expects a view, got list’
yes that’s the error I get
Well the idea is to duplicate the 3D view and then make the duplicate the active view.
1 Like
that’s not the error in your initial screenshot.
You need to loop then
for i in view:
uidoc.RequestViewChange( i )
2 Likes
apologies, I had been trying somethings to resolve it, hence the different error
I give up… I’ve eliminate the errors, but it just won’t open the duplicated view
Thanks for your help… appreciate it
kennyb6
January 25, 2019, 2:31am
18
DuplicateView.dyn (13.1 KB)
This works for me. I had to take out the duplicate options node as it kept giving me errors everytime I opened the graph, making me have to remake the node. Instead I just use a string "Duplicate"
and it works.
me too. I had to install the latest version of the package.
DuplicateView_SD.dyn (21.9 KB)
@EddieSaez It works. Try to close and reopen the dynamo graph. Run manual
1 Like
salvatoredragotta/kenny66
that works … thank you for your assistance, it’s very much appreciated
2 Likes