Changing view type + adding view template

Hello!
I am working on making a script that Duplicates views (elevations), applies a view template to them, and then changes their view type.

We have internal and external working and printing views. We will generally make a set of printing views first for submittal drawings, then we create our working views for placing additional things into walls. is there a way to get dynamo to do both apply our templates + change the duplicated views to a different view type?

I am using both Clockwork and Spring nodes to do this duplicate and rename!

Thank you!

elevations.dyn (11.1 KB)

There’s a bunch of different methods and nodes that can do it. There’s an example above, a few Archilab nodes used.

May require you to play around with the lacing and input levels of the “set” nodes depending on what the input lists of views look like.

Can you tell me what packages you used? This looks like it would work prefect

Those are all core nodes.

Ok i have gotten stuck here. I have the Elevations duplicating and getting renamed just fine, then the view template gets applied. but switching the views type is not working, the error on the Views.GetbyType is giving me an error “Warning: Views.GetByType operation failed. Requested value ‘WORKING ELEVATION’ was not found.” no matter how I put that in there it give me that error with whatever string I had in there. I think im missing something but not sure what!

Thank you all for your help!

view types

Hello @ccraig …could something work for you…

I’m not sure i understand, wouldn’t this just give me all elevation views?

Views.GetByType returns views not view types. You need the ViewFamilyType element for setting the view type of your new views. You can get these via the Element Classes and All Elements of Class nodes (Element Types and All Elements of Type nodes in previous versions.)

So i would then need to filter out so I just have the view type I want (EXTERIOR ELEVATION) and attach that to the parameter name in the SetTypeParameter node?

You would need to filter down to the type that you want, yes. That would be the parameter value though. The parameter name would still be Type.

Ok after fiddling with it i can find a way to just filter down to the type of that exact elevation. this is where I’m getting stuck at

I would get the names of all the view types and filter by name.

Ok i have the filter working bit its still not moving the elevation to the correct spot.
1

That’s because you’re using the EXTERIOR ELEVATIONS template instead of the WORKING ELEVATION template. You need to use the correct template when duplicating the view.

Even with that changed to the WORKING ELEVATION view template it does not move the view to the working elevations area. Shouldn’t the view template not effect the view type? i also fixed it so its not “View” but is “Type” going into the set type parameter node

The only relationship between view type and view template is if the view type has a template to be applied on creation.
image
After the view has been created there’s no tie between the two. So now you need to look at your Browser Organization and see what’s driving your view groups and whether your template is controlling that property.

OK that all looks correct, right? The browser organization is by type and the grouping and sorting is by family and type.

1
Capture

Now I see you’re using Set Type Parameter when this is not a type parameter. You need to use the standard SetParameterByName.

Woohoo That does it! I also needed to add the element.type node into the element.setparamaterbyname node! Thank you so much for your help! Now I just need to make some of the code blocks inputs and should be good!!

Again thank you!

That’s because you’re still getting the Views of that Type instead of the ViewFamilyTypes. If you use Element Classes like I originally mentioned you won’t have to do that and you won’t have to reply on those views already existing.