Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/show view range #2178

Merged
merged 24 commits into from
Apr 28, 2024

Conversation

thumDer
Copy link
Contributor

@thumDer thumDer commented Mar 29, 2024

implementation of #2061

@thumDer
Copy link
Contributor Author

thumDer commented Mar 29, 2024

Need to finalize the ui with a simple control to dinamically show the actual elavation values

@thumDer thumDer requested a review from jmcouffin March 29, 2024 19:50
@github-actions github-actions bot added the needs-more-info Issue required to follow the bug report template. Triggered by the stale issue workflow label Mar 29, 2024
@jmcouffin jmcouffin added New Feature New feature request [class->Implemented #{number}: {title}] and removed needs-more-info Issue required to follow the bug report template. Triggered by the stale issue workflow labels Mar 29, 2024
@thumDer thumDer linked an issue Mar 29, 2024 that may be closed by this pull request
7 tasks
@thumDer thumDer changed the base branch from develop to develop-4 April 4, 2024 11:37
@jmcouffin
Copy link
Contributor

Let me know when you feel it is ready for review @thumDer

@thumDer
Copy link
Contributor Author

thumDer commented Apr 4, 2024

Let me know when you feel it is ready for review @thumDer

Technically it is ready, the core functionality is working, can be tested. I could use some inputs for the ui, though... I'm a bit stuck.

@jmcouffin jmcouffin marked this pull request as ready for review April 4, 2024 15:06
Copy link
Contributor

@jmcouffin jmcouffin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some UI and cosmetic changes.
It seems the windows is not reporting distances for view ranges _ not implemented? Looking quickly at the code, it remains at None Line https://github.com/thumder/pyrevit/blob/d090a31116f70bf9b9219a0ead5aed87356784b7/extensions/pyRevitTools.extension/pyRevit.tab/Toggles.panel/toggles3.stack/ViewRange.pushbutton/script.py#L203
and following

@jmcouffin
Copy link
Contributor

image

@jmcouffin
Copy link
Contributor

All in all a great tool.
If you could implement the levels for cut planes, that would wrap the gift.
UI is fine. Good job @thumDer

@thumDer
Copy link
Contributor Author

thumDer commented Apr 5, 2024

I did some UI and cosmetic changes. It seems the windows is not reporting distances for view ranges _ not implemented?

yep that is still a TODO, but shouldn't take that long. Let me finish it, and it will be ready to merge.

@jmcouffin
Copy link
Contributor

bump ;p @thumDer

@thumDer
Copy link
Contributor Author

thumDer commented Apr 22, 2024

It's happening! :) I might replace the wpf grid to a table, and it would be really great to show the (length) units of the elevation. It is extracted from the project units, but showing it is a bit more complicated than I thought.

@jmcouffin
Copy link
Contributor

Do you want me to merge this first iteration? @thumDer

@thumDer
Copy link
Contributor Author

thumDer commented Apr 23, 2024

I'll try to finish this week with the fine tuning. If I don't have enough time I'll close the PR, and merge it as it is. (If you have no objections, of course.)

@jmcouffin
Copy link
Contributor

jmcouffin commented Apr 23, 2024

🪖no objection. Sir.
Thanks mate

@thumDer
Copy link
Contributor Author

thumDer commented Apr 27, 2024

I consider it done

image

@jmcouffin jmcouffin merged commit 1d7219e into pyrevitlabs:develop-4 Apr 28, 2024
Copy link
Contributor

📦 New public release are available for 4.8.16.24121+2117

@Robbo1234
Copy link

Hi there, I installed pyRevit v4.8.16.24121 and tested 'Show View Range' in Revit 2021.1.9 and I got this error.

_IronPython Traceback:
Traceback (most recent call last):
File "C:\Program Files\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Toggles.panel\toggles3.stack\ViewRange.pushbutton\script.py", line 10, in
ImportError: Cannot import name SelectionChangedEventArgs

Script Executor Traceback:
IronPython.Runtime.Exceptions.ImportException: Cannot import name SelectionChangedEventArgs
at IronPython.Runtime.Importer.ImportFrom(CodeContext context, Object from, String name)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)

@thumDer
Copy link
Contributor Author

thumDer commented May 1, 2024

Yes, that is what I forgot to do to disable the script in versions lower than 2023, because that specific SelectionChanged event was introduced in that version. I will include some warning, but it won't work in those versions. 😔

@Robbo1234
Copy link

Thanks, Btw, I launched Revit 2023.1 to test 'Show View Range' and I'm getting this PyLoader- Error Loading pyRevit

image

@thumDer
Copy link
Contributor Author

thumDer commented May 2, 2024

That seems like a different issue with the pyRevit loader. If it persists please post an issue, with the required information.

@thumDer
Copy link
Contributor Author

thumDer commented May 2, 2024

@jmcouffin I've doublechecked and it might be possible to make this work in earlier Revit versions without the SelectionChanged event, but that will require to abuse the Idling event and might behave differently, or have unexpected results. For now I would suggest to only disable the tool in earlier versions with a warning, but I don't know what is the policy about supporting legacy versions, so I would ask you to decide.

@jmcouffin
Copy link
Contributor

Revit 2021.1.9 and I got this erro
@Robbo1234
You know that 2021 is not supported by Autodesk anymore, right?

@jmcouffin
Copy link
Contributor

Idling event

@thumDer I would avoid that.
You could just use the bundle min-version flag:

# minimium supported Revit version
min_revit_version: 2023

or do it in the tool script itself, but I prefer the use of the flag

There is no particular will to support legacy versions when adding new tools.

@thumDer
Copy link
Contributor Author

thumDer commented May 2, 2024

I thought that must be a thing, just didn't have time to doublecheck :D I'll update the bundle on the dev branch

@thumDer
Copy link
Contributor Author

thumDer commented May 2, 2024

done via 5c12574

@Robbo1234
Copy link

Robbo1234 commented May 2, 2024 via email

@jmcouffin jmcouffin mentioned this pull request May 3, 2024
7 tasks
@RevitIRL
Copy link

RevitIRL commented May 8, 2024

If Levels are turned off in v/g (our default), I get this:

Traceback (most recent call last): 
 File "C:\Users\<username>\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Toggles.panel\toggles3.stack\ViewRange.pushbutton\script.py", line 128, in context_changed 
 corners = corners_from_bb(level_bbox) 
 File "C:\Users\<username>\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Toggles.panel\toggles3.stack\ViewRange.pushbutton\script.py", line 95, in corners_from_bb 
 transform = bbox.Transform 
AttributeError: 'NoneType' object has no attribute 'Transform' 

Also, I notice the extents of the colored planes match the extents of Level 1 (or maybe the first Level in the model) instead of matching the extents of the view.

@jmcouffin
Copy link
Contributor

If Levels are turned off in v/g (our default), I get this:

Traceback (most recent call last): 
 File "C:\Users\<username>\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Toggles.panel\toggles3.stack\ViewRange.pushbutton\script.py", line 128, in context_changed 
 corners = corners_from_bb(level_bbox) 
 File "C:\Users\<username>\AppData\Roaming\pyRevit-Master\extensions\pyRevitTools.extension\pyRevit.tab\Toggles.panel\toggles3.stack\ViewRange.pushbutton\script.py", line 95, in corners_from_bb 
 transform = bbox.Transform 
AttributeError: 'NoneType' object has no attribute 'Transform' 

Also, I notice the extents of the colored planes match the extents of Level 1 (or maybe the first Level in the model) instead of matching the extents of the view.

Please create an issue/feature request @RevitIRL
It will be easier to follow up and prioritize

@RevitIRL
Copy link

RevitIRL commented May 8, 2024

cool :)

#2244
#2245
#2246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature New feature request [class->Implemented #{number}: {title}]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show View Range
6 participants