Alpha-numeric detail numbering

revit
dynamo
python
#1

Hello!
I’m looking to name views on sheets in alpha-numberic order based on a 6x6 grid and am super close - The script I’ve cobbled together from various videos works, but the catch for this particular task requires inverting the x-axis so theoretical detail view “1A” will be on the lower right-hand side near title block, instead of at the binding side. I’ll be upfront, I’ve got very little Dynamo skills and even less Python… but basic premises of each understood. I think the fix lies in inverting the x-axis in the Viewport Properties node python script.
Is there some python language which can invert the 0 position (so to speak) to have the desired outcome below?
Many thanks from a green newb!

let me know if it would help anyone to have the .dyn file to facilitate a solution

0 Likes

#2

@anthony_rash_goodycl Could you upload your .dyn? Will be easier to figure out what could be modified

0 Likes

#3

The server is calling me a ‘new user’ and won’t let me directly upload the .dyn file to the post -
is it ok to post a link via google drive for you to download? is there another way to do so if this is not acceptable?

https://drive.google.com/open?id=1kBi9rfe1XISeTyu6YSgY0Qj4VHQ97aac

0 Likes

#4

See image of script

0 Likes

#5

@AW_Rash Using a file sharing service is totally acceptable! :slight_smile: I’m not sure if it is mentioned here but check out this post if you have not yet: How to get help on the Dynamo forums

Also when sharing an image of a graph its best to zoom in until the node labels are visible, and use the camera button on the top right of Dynamo (it will capture the whole graph even if it isn’t visible zoomed in)

Here is a post with a graph that might have some parts which would help:

That graph isn’t using an alpha-numeric system, however. Maybe create a Coordinate System from the Titleblock’s location point, and mirror that on a plane created in the center of sheet. You can then transform the viewport’s location points from the old coordinate system to the new one so their x values are right to left, see the blue group in the image below:

I was missing the List.DuplicatedItemIndices node you used towards the end, and used a couple of different nodes from Rhythm for obtaining the sheet’s viewports and their location data. Let me know if it works for you!

1 Like

#6

I think this will work as well. I did not test it but I think my math works and I put it in the correct spot.

0 Likes

#7

I have also recreated the script you copied about a year ago. I put a min and max in to make sure the numbers or letters were not less than 1 or greater than 6 (max number of cells). My notes are backwards for numbers and letters (just saw that).

0 Likes

#8

@Steven Ah yes that logic does make sense! I tested yours on the Revit sample architectural project and maybe I had just misinterpreted your numbering standard/method

Here is with your script:

Verse the method above:

1 Like

#9

Yes what you showed is the intended use of my script. I am debating the correct numbering for 2 and 3. Since I am determining the view’s location from the top right 2 and 3 come before 4 but if I were to number based on the bottom left 2 and 3 would come after 5 before 6. Easy to change BBox min or max.

Looks like my math worked as well. :smile: I did not want to run it on the project I had open but I was hoping I got it right. Thanks for the proof of concept Amy.

1 Like

#10

@Steven Yep it definitely works! I usually use the sample projects to test stuff like that since its all set up already. The 2 & 3 did throw me off as to how your graph would be adjusted for the alpha-numeric grid format, but the math approach you took was certainly clever and I’m sure it could conform to the alpha-numeric format. (Your firm does indeed number oddly though - however the placement of 2 and 3 would make perfect sense to me if the viewport title ran right to left)

1 Like

#11

Wow you guys are quick… I’ve just had the chance to read the latest posts and am testing @awilliams solution now. I’d like to also test @Steven but most likely won’t get the chance to do it tonight.
I’ll recheck once completed. Thanks again for so much help! :grin:

0 Likes

#12

Mine should only take you 1 minute to check. only need to add a code block and Math.Abs to your graph.

1 Like

#13

well…Detail sheets run right to left. floor plans, section, elevations run left to right :sweat_smile: Its an old method and no one wanted to use the stick to make everyone change over to the CAD standard. I just make the tools however they need to be made.

1 Like

#14

Hi All,
I’m having some trouble with the script … it doesn’t want to work quite as expected. I changed lacing to longest at Geometry nodes which helped but there’s still some disconnect with the script… perhaps how it reads the grid. I can reupload the script if there are no immediate thoughts form anyone.
Again, I’m a bit green so thanks for patience and for help!

0 Likes

#15

Hmm those results are peculiar… are those drafting views? Do the geometry outputs from the Rhythm node Viewport.LocationData (if you swapped that one in) appear to be in the correct location?

By the logic of the graph, I’d think those detail numbers could only happen if there is something off about the viewports locations themselves :face_with_raised_eyebrow: Would you upload a screenshot of the graph with the previews pinned for these nodes (Viewport.LocationData, BoundingBox.MinPoint, Geometry.Transform)

0 Likes

#16

As requested, an image of the graph in it’s entirety with Viewpoint.LocationData, BBox.MinPoint and Geometry.Transform previews pinned.
I took some time investigating other possible alternatives, such as the vector axis, grid geometries and other random testing to satiate my curiosity. The views are a mix of drafting and detail views; you suggest a possible problem with the Revit family?
The original script i used seemed to have no problem, other than it didn’t invert the x-axis. Maybe there’s a solution where i return to that as an option?

0 Likes

#17

Hi @awilliams - I took my own advice and after a lot of messing around last night decided to eliminate a variable, that being the “views” and keeping “viewports.” I swaped Sheet.getviewportsandviews for Sheets.viewports and voula!
Everything seems to be working smoothly now. Thanks so much for all your support @awilliams and @Steven - many thanks.

0 Likes

#18

@AW_Rash glad you got it working! I’m really quite curious about the differing results between the Sheets.Viewports node and Sheet.GetViewportsAndViews. I’m trying to test it but can’t seem to recreate the issue.

@john_pierson any chance you’ve encountered strange results with viewports and their locations? It seems here the Rhythm nodes might have been producing incorrect results in comparison to the Hollandaise viewport nodes :face_with_raised_eyebrow:

0 Likes

#19

@awilliams trying to catch up here. Where did the difference occur?

0 Likes

#20

Sorry I should have clarified better, the image on this part of the thread shows:

The locations appear to be off given that their detail numbers weren’t making sense, and it was resolved by switching the Rhythm nodes out back to the Hollandaise nodes

0 Likes