Hi I need to create a series of parallel perspective views that are 1000mm above each floor plane/level in order to do a bunch of solar analysis views for a DA. I have tried using the Perspective.View.ByEyePointAndTarget node but it continues to tell me that I have the wrong input, despite me feeding it exactly what it states on the node. Any assistance would be much appreciated, screen shot is attached.
looks like youâre feeding a level element in when the node wants a string. Put an element.name node in where the code block âlistâ is used.
Also I think you may have a list thatâs two levels deep for points but only a single level deep the target points. Mismatched lists structures will get you every time. I think removing the list.create node if so, which should clear it up.
Try changing those things and you post back but include more watch nodes so we can compare your data types and structures if youâre still stuck.
Iâm getting views out now, but for some reason they seem to be incredibly skewed. I tried with an axonometric view node which gave me clean views but none of them came in at the right eye elevation and target elevation. What I really want is a camera view that is set to parallel 1m above each floor level. Any Ideas?
To be honest I think all I need now is a custom node that switched the camera view to parallel
Can you post a Revit view of what you are seeing and what you would want? Hard to understand the issue otherwise.
Iâm also unaware of a way to change a view to an axon after making a perspective.
As a side note you may want to clean up the wiring on the nodes so you can see the flow of your data easier. While itâs working well today a year from now you may need to tweak it and not being able to see where inputs are coming from easily makes that a lot harder.
Thatâs how the view comes into revit at the moment, itâs fairly easily fixed but if thereâs more than a hundred views, it does become a tedious and time consuming process. Thank you for the help so far by the way
Ah!
No idea what the parameter name is or value you need to assign in order to achieve your end goal. It may not even be accessible by via dynamo or from he API. That said, you can try some trouble shooting on your own now.
In a blank file make a new perspective view, duplicate the view and set the duplicate to a parallel perspective. Get both views in Dynamo, and then wire in an Element.Parameters node to read both parameters. Use a list.sort node on the output with the lacing set to âlongestâ to ensure all parameters are listed in the same order. Then wire in a code block with the contents a[0]==a[1]. This will return a value of false for each parameter name and value which doesnât perfectly match up. The view name will return false, and the parameter associated with the parallel setting or not it will also return false. I believe the parameter is called âPerspectiveâ but I canât confirm that so look over the results closely.
Once you have the correct parameter name and value, try setting the parameter value for the non-parallel view using an Element.SetParameterByName to the value in the parallel view. If all of that all worked then use the same Element.SetParameterByName node to assign the correct value to the results of your previous graph and you should be all set.
If that doesnât work post your results and we can try to help further, but if it doesnât work I think weâll need to use a python script to access the API.
Sorry Jacob, still having some issues with the script. I have found the parameters that I need to change, they are âLocked Orientationâ and âPerspectiveâ. Unfortunately the Parameter.SetValue node doesnât seem to be responding. I have tried plugging in a code block with âNoâ and â0â as well as a string node and an integer of 0 but none seem to respond.
@julian.venczel Have you found a solution? I have same questions and I would like to edit those parameters
Has been a while since I looked at it but this should help:
import clr
clr.AddReference(âRevitAPIâ)
from Autodesk.Revit.DB import *
Import DocumentManager and TransactionManager
clr.AddReference(âRevitServicesâ)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
Get the document
doc = DocumentManager.Instance.CurrentDBDocument
views=UnwrapElement(IN[0])
Start the transaction
TransactionManager.Instance.EnsureInTransaction(doc)
[i.Unlock() for i in views]
End the transaction
TransactionManager.Instance.TransactionTaskDone()
just put it all into a python node and stick the view in.
Also those headings are actually just comments in the code, they donât need to go in.
Hello @julian.venczel
Thanks for your reply.
I read at the code and I understand that the views will be unlocked, but how do you switch a 3D view perspective to âNo perspectiveâ?
Thanks
The API command is ToggleToPerspective() or ToggleToIsometric()
you could put it into the loop so it would be
TransactionManager.Instance.EnsureInTransaction(doc)
[i.Unlock() for i in views]
i.ToggleToIsometric()
TransactionManager.Instance.TransactionTaskDone()