cyrilwaechter / pyrevitmep Goto Github PK
View Code? Open in Web Editor NEWPyRevitMEP - MEP Extensions for PyRevit
License: GNU General Public License v3.0
PyRevitMEP - MEP Extensions for PyRevit
License: GNU General Public License v3.0
Hi when I try to Select Object from Change Level feature my Revit gets fatal error and it crashes
Describe the bug
Family Parameter editor crashes when attempting to commit new family parameters, whether from Shared Parameters or Family parameters. (Code workaround included)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expected parameter to be added to the family and be accessible in native RVT tools.
Screenshots
Not included
Versions (please complete the following information):
Additional context
The problem is in managefamily.py, near line 105. pyRevitMEP is attempting to determine if the Shared Parameter file is in Unicode or UTF-8 encoding, but the pyRevit function in coreutils.check_revittxt_encoding() is no longer present in 4.8.12 (or maybe earlier). Temporary workaround: My Shared Parameter file was Unicode-encoded so edit %Appdata%\pyRevit\Extensions\PyRevitMEP.extension\lib\pyrevitmep\parameter\managefamily.py near line 103:
Versions (please complete the following information):
Additional context
IronPython Traceback:
Traceback (most recent call last):
File "D:\pyRevit-Master\extensions\PyRevitMEP.extension\pyRevitMEP.tab\Manage.panel\Parameters.stack3\ManageSharedParameter.pushbutton\script.py", line 12, in
File "D:\pyRevit-Master\extensions\PyRevitMEP.extension\lib\pyrevitmep\parameter\manageshared.py", line 224, in show_dialog
File "D:\pyRevit-Master\extensions\PyRevitMEP.extension\lib\pyrevitmep\parameter\manageshared.py", line 95, in save_click
File "D:\pyRevit-Master\extensions\PyRevitMEP.extension\lib\pyrevitmep\parameter_init_.py", line 253, in delete_from_definition_file
UnicodeDecodeError: ('unknown', '\x00', 12, 13, '')
Script Executor Traceback:
System.Text.DecoderFallbackException: 无法将位于索引 12 处的字节 [00] 由指定的代码页转换为 Unicode。
在 Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)
在 Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)
在 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
在 IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction function, Object arg0, Object arg1, Object arg2)
在 System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
在 IronPython.Compiler.Ast.CallExpression.Invoke2Instruction.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
在 IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction function, Object arg0, Object arg1, Object arg2)
在 CallSite.Target(Closure , CallSite , Object , Object , RoutedEventArgs )
在 System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
在 Scripting(Object[] , Object , RoutedEventArgs )
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
在 System.Windows.Controls.Primitives.ButtonBase.OnClick()
在 System.Windows.Controls.Button.OnClick()
在 System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
在 System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
在 System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
在 System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
在 System.Windows.Input.InputManager.ProcessStagingArea()
在 System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
在 System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
在 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
在 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
在 System.Windows.Window.ShowHelper(Object booleanBox)
在 System.Windows.Window.ShowDialog()
在 Microsoft.Scripting.Interpreter.FuncCallInstruction2.Run(InterpretedFrame frame) 在 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) 在 Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2) 在 System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) 在 Microsoft.Scripting.Interpreter.FuncCallInstruction
5.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
在 IronPython.Compiler.Ast.CallExpression.Invoke0Instruction.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
在 IronPython.Runtime.Method.MethodBinding.SelfTarget(CallSite site, CodeContext context, Object target)
在 System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
在 Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
在 IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
在 PyRevitLabs.PyRevit.Runtime.IronPythonEngine.Execute(ScriptRuntime& runtime)
建筑规划方案.txt
Describe the bug
When I want to use Duct transition function, it flushes error window and not connect the ducts
in various cases as seen in videos below.
To Reproduce
Steps to reproduce the behavior:
my assumption is function has bigger troubles to connect ducts which are not actually attachet in some system (unattached) from existing. but this behaviour is also seen in ducts attached to some system.
Expected behavior
Function wil connect ducts wether they are attached or are not attached to some system.
Function will not show error messages.
Screenshots
YT video :
https://youtu.be/DS4RA2pmcFI
YT video 2:
https://youtu.be/-fM6iFVm9aU
Versions (please complete the following information):
Revit 2019.2
pyRevit: [e.g. 4.7.5, pyRevit dropdown -> About and take a screenshot]
pyRevitMEP [e.g. c98e12c, pyRevit dropdown -> Extensions -> Last commit column (this is the hash of the last commit)]
ef88788
rocket mode activated : Yes/No
yes
ironpython engine : [eg. 2.7.7]
most probably 2.7.3 (2.7.40) on .NET 4.0.30319.42000
(checked command line of IronPython Console)
cpython engine : [eg. 3.7.2]
not sure where to find the version
Additional context
none
Describe the bug
Doesn’t work with generic model on Revit 2023.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Object reference is supposed to be changed without moving.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
Additional context
Add any other context about the problem here.
IronPython Traceback:
Traceback (most recent call last):
File "\pyrevit\pyRevitMEP.extension\pyRevitMEP.tab\Tools.panel\Manage.pulldown\ManageFamilyParameter.pushbutton\script.py", line 8, in
File "\pyrevit\pyRevitMEP.extension\lib\pypevitmep\parameter\managefamily.py", line 180, in show_dialog
File "\pyrevit\pyRevitMEP.extension\lib\pypevitmep\parameter\managefamily.py", line 119, in ok_click
File "\pyrevit\pyRevitMEP.extension\lib\pypevitmep\parameter\__init__.py", line 382, in save_to_revit
TypeError: expected ExternalDefinition, got InternalDefinition
Need to create or retrieve definition from a definition file instead ? Would type casting work ?
When elements are selected and "Delete Button" is pressend nothing happens.
If I put an print "something" statement in the Execute method,
just before the self.dothis() function call nothing happens too.
editnr1:
REvit version 2019
latest pyrevit version, 4.7.4
latest extensions. latest pyrevitMEP extension.
The External Event_delete Sample_script works. Meaning. The Execute Method is fired.
selected objects are deleted.
edit nr2:
The ExternalEvent_delete Sample_script does not work either:
When you comment out the last line.
"ExternalEventMy.Execute(handler_event, uidoc)", (which should not be needed.)
When the event is raised: exEvent.Raise() the Execute method of the ExternalEventMy class
should fire. But it doesn't.
When you copy and paste the whole code (except the last line) in to RPS, after exiting the RPS.
selected objectts are deleted ---> Execute method is invoked. Selected objects are deleted.
The external Event.Raise() does not work, when starting the script from a button in pyrevit.
When you do this with C# in an Revit Macro this works.
See the youtube vid: 5 Secrets of Revit API coding.
But I haven't figuered everything out yet.
Thank you very much for your script though. huge Inspiration.
Describe the bug
A clear and concise description of what the bug is.
I tryied to use fucnction RoomToSpace for the first time. But there is no manual for it. How to use ?
Do you have to copy rooms to your own model and create spaces before use this function ?
Or You have to create just spaces and function will suck data from rooms from linked model ?
Or does function do all above mentioned on its own ?
do I have to have selected Rooms before application of functions ? or do i have to have selected spaces ?
or do i have to have selected both - spaces + rooms before application function ?
ot of questions arise when the error window occurs and user sipmly is not sure if he did not use the proper way
To Reproduce
Steps to reproduce the behavior:
Expected behavior
room data from rooms would be copied to spaces
Screenshots
error :
IronPython Traceback:
Traceback (most recent call last):
File "C:\Users\Richard_dell\AppData\Roaming\pyRevit\Extensions\PyRevitMEP.extension\pyRevitMEP.tab\Data.panel\RoomToSpace.pushbutton\script.py", line 154, in
File "C:\Users\Richard_dell\AppData\Roaming\pyRevit\Extensions\PyRevitMEP.extension\pyRevitMEP.tab\Data.panel\RoomToSpace.pushbutton\script.py", line 33, in init
TypeError: 'DocumentSet' object is not subscriptable
Script Executor Traceback:
IronPython.Runtime.Exceptions.TypeErrorException: 'DocumentSet' object is not subscriptable
at Microsoft.Scripting.Runtime.LightExceptions.ThrowException(LightException lightEx)
at Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow(Object value)
at Microsoft.Scripting.Interpreter.FuncCallInstruction2.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2) at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite
1.CallTarget(CallSite site, CodeContext context, Object inst, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at IronPython.Runtime.Types.PythonType.FastTypeSite1.CallTarget(CallSite site, CodeContext context, Object type, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Microsoft.Scripting.Interpreter.DynamicInstruction
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)
Versions (please complete the following information):
pyRevitMEP [e.g. c98e12c, pyRevit dropdown -> Extensions -> Last commit column (this is the hash of the last commit)]
92d9398
rocket mode activated : Yes
ironpython engine : 2.7.7
cpython engine : 3.8.5
Additional context
Add any other context about the problem here.
drawing a wall or Curtain Wall creates a direction.
could it be possible to get the direktion marked in the drawings? and create Sections on the oposide? maybe by clicking in direction?
F.ex. I would like to create Wall-Sections/Elevations of a Octogon Room. with Revit Build In functions this is not possible. but when I have drawn in wrong direction, all sections will be outside.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
Additional context
Add any other context about the problem here.
I get an error for a missing excel icon =)
INFO: [Reload] Reloading....
INFO: [pyrevit.loader.sessioninfo] pyRevit version: 4.4:08a3297 - with in Portland, OR
INFO: [pyrevit.loader.sessioninfo] Host is Autodesk Revit 2018 (build: 20170927_1515(x64) id: 6272)
INFO: [pyrevit.loader.sessioninfo] Running on: 2.7.7 (IronPython 2.7.7 (2.7.7.0) on .NET 4.0.30319.42000 (64-bit))
INFO: [pyrevit.loader.sessioninfo] Home Directory is: C:/ProgramData/pyRevit/pyRevit-v4/pyRevit
INFO: [pyrevit.loader.sessioninfo] Session uuid is: c7d20ddc-0812-11e8-95cb-7da2546aeb90
INFO: [pyrevit.loader.sessioninfo] Base assembly is: pyRevit_2018_27e577b999513998_PyRevitBaseClasses
INFO: [pyrevit.loader.sessioninfo] Config file is: C:/Users/tvogt/AppData/Roaming/pyRevit/pyRevit_config.ini
INFO: [pyrevit.extensions.extensionmgr] UI Extension successfuly loaded from cache: pyApex
INFO: [pyrevit.extensions.extensionmgr] UI Extension successfuly loaded from cache: pyRevitCore
INFO: [pyrevit.extensions.extensionmgr] Skipping disabled ui extension: pyRevitDevTools
INFO: [pyrevit.extensions.extensionmgr] UI Extension successfuly loaded from cache: PyRevitMEP
INFO: [pyrevit.extensions.extensionmgr] UI Extension successfuly loaded from cache: PyRevitPlus
INFO: [pyrevit.extensions.extensionmgr] UI Extension successfuly loaded from cache: pyRevitTools
INFO: [pyrevit.extensions.extensionmgr] Skipping disabled ui extension: pyRevitTutor
INFO: [pyrevit.extensions.extensionmgr] UI Extension successfuly parsed: rvt_fixme
INFO: [pyrevit.extensions.extensionmgr] Updating cache for ui_extension: rvt_fixme
INFO: [pyrevit.loader.sessionmgr] Extension assembly created: pyApex
INFO: [pyrevit.loader.sessionmgr] UI created for extension: pyApex
INFO: [pyrevit.loader.sessionmgr] Extension assembly created: pyRevitCore
INFO: [pyrevit.loader.sessionmgr] UI created for extension: pyRevitCore
INFO: [pyrevit.loader.sessionmgr] Extension assembly created: PyRevitMEP
ERROR: [pyrevit.coreutils.ribbon] Error adding icon for Excel | Can not create icon from given file: None | Name: Excel RevitAPIObject: <Autodesk.Revit.UI.PushButton object at 0x000000000000073B [Autodesk.Revit.UI.PushButton]>
Traceback:
File "C:/ProgramData/pyRevit/pyRevit-v4/pyRevit/pyrevitlib/pyrevit/coreutils/ribbon.py", line 768, in create_push_button
existing_item.set_icon(icon_path, icon_size=ICON_LARGE)
INFO: [pyrevit.loader.sessionmgr] UI created for extension: PyRevitMEP
INFO: [pyrevit.loader.sessionmgr] Extension assembly created: PyRevitPlus
INFO: [pyrevit.loader.sessionmgr] UI created for extension: PyRevitPlus
INFO: [pyrevit.loader.sessionmgr] Extension assembly created: pyRevitTools
INFO: [pyrevit.loader.sessionmgr] UI created for extension: pyRevitTools
INFO: [pyrevit.loader.sessionmgr] Extension assembly created: rvt_fixme
INFO: [pyrevit.loader.sessionmgr] Running startup tasks...
INFO: [pyrevit.loader.sessionmgr] UI created for extension: rvt_fixme
INFO: [pyrevit.loader.sessionmgr] Load time: 4.5554 seconds
Sorry, I have a report a bug because I can't pull a request.
I would like to add an function to hide a element in a view like :
https://knowledge.autodesk.com/community/screencast/6add9619-6bec-468e-b166-a93f10777750
Can you make it or explain how I can help you ?
I have done it without dynamo :
{ "Uuid": "f14a0f38-07c3-49d0-a1e2-0ee3b6307846", "IsCustomNode": false, "Description": null, "Name": "Cacher un tronçon", "ElementResolver": { "ResolutionMap": {} }, "Inputs": [], "Outputs": [], "Nodes": [ { "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", "NodeType": "FunctionNode", "FunctionSignature": "Revit.Elements.Element.OverrideInView@Revit.Filter.OverrideGraphicSettings,bool", "Id": "e5878418d13145bd99776438bd895f79", "Inputs": [ { "Id": "ad0282ee13ac44888a11851c604e29b9", "Name": "element", "Description": "Revit.Elements.Element", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "5fca401d7a6f4aedb07acf903ab258a3", "Name": "overrides", "Description": "Override Graphics Settings.\n\nOverrideGraphicSettings", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "265a6623e32645b1990b002a3e35f673", "Name": "hide", "Description": "If True given Element will be hidden.\n\nbool\nDefault value : false", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Outputs": [ { "Id": "fe81d221f6cb4c1d902a9143fb33a31f", "Name": "Element", "Description": "Element", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Replication": "Auto", "Description": "Override Elements Graphics Settings in Active View.\n\nElement.OverrideInView (overrides: OverrideGraphicSettings, hide: bool = false): Element" }, { "ConcreteType": "Dynamo.Nodes.DSModelElementSelection, DSRevitNodesUI", "NodeType": "ExtensionNode", "InstanceId": [ "30619862-bc34-4d1b-96fb-5844510871ac-0018745b" ], "Id": "31c1cf30e13a42fb9c2e26f1ce32f17f", "Inputs": [], "Outputs": [ { "Id": "29c6ab80b5854bf0acaaebee49f9bf38", "Name": "Element", "Description": "The selected elements.", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Replication": "Disabled" }, { "ConcreteType": "CoreNodeModels.Input.BoolSelector, CoreNodeModels", "NodeType": "BooleanInputNode", "InputValue": true, "Id": "1cf81fe4e3244006a937b7cb1aacc72f", "Inputs": [], "Outputs": [ { "Id": "8533915159a54e15a35d9528d2c1d1b8", "Name": "", "Description": "Boolean", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Replication": "Disabled", "Description": "Selection between a true and false." }, { "ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore", "NodeType": "FunctionNode", "FunctionSignature": "[email protected],DSCore.Color,DSCore.Color,DSCore.Color,Revit.Elements.FillPatternElement,Revit.Elements.FillPatternElement,Revit.Elements.LinePatternElement,Revit.Elements.LinePatternElement,int,int,int,string,bool", "Id": "01d8c99111ec4850b76ee890108cba48", "Inputs": [ { "Id": "cf5dd177296044589d4ca991a96636f1", "Name": "cutFillColor", "Description": "Fill color\n\nColor\nDefault value : null", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "71aed1b885eb4245864b1ab8361fdb26", "Name": "projectionFillColor", "Description": "Projection color\n\nColor\nDefault value : null", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "983c2390246f46698ff301d115fa6be3", "Name": "cutLineColor", "Description": "Cut line color\n\nColor\nDefault value : null", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "77c4fb9497cf4888b106838e6ba8b95a", "Name": "projectionLineColor", "Description": "Projection line color\n\nColor\nDefault value : null", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "1d57f236466d4d6a909a2c767d7eb8aa", "Name": "cutFillPattern", "Description": "Cut fill pattern\n\nFillPatternElement\nDefault value : null", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "e5119982772d408c97947782b8048d24", "Name": "projectionFillPattern", "Description": "Projection fill pattern\n\nFillPatternElement\nDefault value : null", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "983fa3a0d48545e988ff036182234e0c", "Name": "cutLinePattern", "Description": "Cut line pattern\n\nLinePatternElement\nDefault value : null", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "d01921db6dce42f39fa73ce750957869", "Name": "projectionLinePattern", "Description": "Projection line pattern\n\nLinePatternElement\nDefault value : null", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "f67d11c152f640f897d16d53e02a2d48", "Name": "cutLineWeight", "Description": "Cut line weight\n\nint\nDefault value : -1", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "2290977bf12146d3aaa3b23c637bcfd9", "Name": "projectionLineWeight", "Description": "Projection line weight\n\nint\nDefault value : -1", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "e65af182359d43a993c4727b461e6284", "Name": "transparency", "Description": "Transparency as integer between 1-100.\n\nint\nDefault value : -1", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "f095f2996c394034ac594f20c978c788", "Name": "detailLevel", "Description": "Detail Level setting, ex: Coarse, Fine etc.\n\nstring\nDefault value : \"Undefined\"", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false }, { "Id": "4eb924cd9ab14b9e9b3536b85cb22a78", "Name": "halftone", "Description": "Halftone. True = halftone.\n\nbool\nDefault value : false", "UsingDefaultValue": true, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Outputs": [ { "Id": "2c0e0b93b93143818bb292b7cdaa17fc", "Name": "overrides", "Description": "Override Graphic Settings", "UsingDefaultValue": false, "Level": 2, "UseLevels": false, "KeepListStructure": false } ], "Replication": "Auto", "Description": "Create a OverrideGraphicSettings Element.\n\nOverrideGraphicSettings.ByProperties (cutFillColor: Color = null, projectionFillColor: Color = null, cutLineColor: Color = null, projectionLineColor: Color = null, cutFillPattern: FillPatternElement = null, projectionFillPattern: FillPatternElement = null, cutLinePattern: LinePatternElement = null, projectionLinePattern: LinePatternElement = null, cutLineWeight: int = -1, projectionLineWeight: int = -1, transparency: int = -1, detailLevel: string = \"Undefined\", halftone: bool = false): OverrideGraphicSettings" } ], "Connectors": [ { "Start": "29c6ab80b5854bf0acaaebee49f9bf38", "End": "ad0282ee13ac44888a11851c604e29b9", "Id": "0ade2516034e4099b0474944db3e7688" }, { "Start": "8533915159a54e15a35d9528d2c1d1b8", "End": "265a6623e32645b1990b002a3e35f673", "Id": "fd8edae7fe944292a03f06a3114ee3c2" }, { "Start": "2c0e0b93b93143818bb292b7cdaa17fc", "End": "5fca401d7a6f4aedb07acf903ab258a3", "Id": "5562b848246c43b795d988b00bf3f8e3" } ], "Dependencies": [], "NodeLibraryDependencies": [], "Bindings": [], "View": { "Dynamo": { "ScaleFactor": 1.0, "HasRunWithoutCrash": true, "IsVisibleInDynamoLibrary": true, "Version": "2.3.0.5885", "RunType": "Manual", "RunPeriod": "1000" }, "Camera": { "Name": "Background Preview", "EyeX": -17.0, "EyeY": 24.0, "EyeZ": 50.0, "LookX": 12.0, "LookY": -13.0, "LookZ": -58.0, "UpX": 0.0, "UpY": 1.0, "UpZ": 0.0 }, "NodeViews": [ { "ShowGeometry": true, "Name": "Element.OverrideInView", "Id": "e5878418d13145bd99776438bd895f79", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 2011.4681906433952, "Y": -237.57880036993691 }, { "ShowGeometry": true, "Name": "Select Model Element", "Id": "31c1cf30e13a42fb9c2e26f1ce32f17f", "IsSetAsInput": true, "IsSetAsOutput": false, "Excluded": false, "X": 1492.2319233593175, "Y": -310.9438675056852 }, { "ShowGeometry": true, "Name": "Boolean", "Id": "1cf81fe4e3244006a937b7cb1aacc72f", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 1602.8126748654502, "Y": 346.50643374250592 }, { "ShowGeometry": true, "Name": "OverrideGraphicSettings.ByProperties", "Id": "01d8c99111ec4850b76ee890108cba48", "IsSetAsInput": false, "IsSetAsOutput": false, "Excluded": false, "X": 1471.9805850069617, "Y": -139.54367167328718 } ], "Annotations": [], "X": -693.04636557113213, "Y": 341.98307957158642, "Zoom": 0.66374309525808672 } }
TODO
Hi,
I tried the code from here but I got an exception.
My installed Versions
Revit: 19.2.10.7
pyRevit: 4.7.4
What I did:
The Result is:
IronPython 2.7.7 (2.7.7.0) on .NET 4.0.30319.42000 (64-bit)
Type "help", "copyright", "credits" or "license" for more information.Exception : IronPython.Runtime.Exceptions.ImportException: No module named revitutils
bei Microsoft.Scripting.Runtime.LightExceptions.ThrowException(LightException lightEx)
bei Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow(Object value)
bei Microsoft.Scripting.Interpreter.FuncCallInstruction`2.Run(InterpretedFrame frame)
bei Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
bei Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
bei IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
bei Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
bei Microsoft.Scripting.Hosting.ScriptSource.ExecuteAndWrap(ScriptScope scope, ObjectHandle& exception)
I need to mention, that I have few experience with Revit and Python. I usually work in AutoCAD or Inventor with .NET.
What have I done wrong.
Regards, Andreas
steps
Versions (please complete the following information):
When I tried out renaming my views with your tool, I could not edit the formula for the name generation. All I did was click into the given values. When no cursor appeared, I clicked again. I did not count the number of times I clicked but I ended up with a Revit crash screen sending my data off to Autodesk. I only tried out floor plans so the other entries may be fine.
Hi,
I used "create a new empty definition file (standard revit shared parameter file) and then used save parameters to definition file. Every work fine and when i open the text file everything looks good.
When i try to use this definition file to bring in some of the shared parameters to a new projects, nothing is showing up. I don't get any error regarding the file, but no parameter shows. I have tried using revit and also Load from definition file in your tool !!!!
Could you please share the codes that write the parameters to the definitions file, so i could have a look. Thanks
Hi. I really appreciate if you could revise the docstrings to be more specific and exactly explain what the tool does and what conditions need to be set for the tool to work properly. For example on the Rename Views
tools the user would want to know:
Title of Sheet
property would also be affected?Describe the bug
Hi! It seems that pyRevitMEP's Change Level function doesn't keep the objects in place. Some stay in place already by default in Revit but at least the categories listed in the title still change their elevation when changing the level.
The behavior of MEP objects has changed in some of the latest Revit updates when changing their level and it seems that also some of our Dynamo scripts that are supposed to solve the same problem have become "broken" in these newer versions. Not that those Dynamo scripts are of your concern, but I'm trying to give guesses about the underlying problem.
To Reproduce
Steps to reproduce the behavior:
Trying to change the level of any object that belongs to the listed categories moves it (or tries to move it and gives error if the network can't cope with it) according to the difference in level height.
Expected behavior
I suppose the objects would be expected to stay in the same elevation when using pyRevitMEP's Change Level function.
Versions (please complete the following information):
Describe the bug
Hello Cyril,
function 3d rotate does not work :(
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I should rotate duct elements
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
Additional context
sorry to show you it is not working :(
logs attached for download here:
pyRevitMEP.zip
When initiating this tool I get a crash in Revit 2019.2.10.7 before I even select the item.
Any advice?
Describe the bug
Hi, I am using you 3D rotate command a lot. I've installed Revit 2022 yesterday, and now this command throws this:
IronPython Traceback:
Traceback (most recent call last):
File "C:\Users\mgo\AppData\Roaming\pyRevit\Extensions\PyRevitMEP.extension\pyRevitMEP.tab\Modify.panel\Element3DRotation.pushbutton\script.py", line 26, in
ImportError: Cannot import name UnitType
Script Executor Traceback:
IronPython.Runtime.Exceptions.ImportException: Cannot import name UnitType
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)
I think UnitType type has been removed in 2022, as I had to remove reference to it from my addins also.
Versions (please complete the following information):
I would love to be able to align an elevation view to a wall. Right now to tool works if i align the wall to the elevation, but I need to do the opposite.
revit 2017, pyrevit latest update
workflow:
create shared parameters -> save
menu manage project parameters
select parameters from shared parameter file (Button "I") (Button"[<-]) (Button "OK")
set values for 3 parameters of same group (all parameters are assigned to same classes)
click (Button"OK") or (Button"Save")
CRASH
error message:
Hi
Before, the Change Level tool kept the elements' position in space when changing the reference level, which was very useful, but now the element moves when this tool is used.
This happens for FamilyInstances.
I am working with MEP side of Revit, and changing ref level of Pipes does not move them in space, but fittings (FamilyInstances) move. This was not the case before.
How can i manual pyRevitMEP on pyRevit?
I have clone pyRevitMEP from Github and place the map pyRevitMEP.tab in the extension map on C:/pyRevit/
But now i get the follow notification:
I think he's looking for the "lib" directory. This directory is in the clone from GitHub.
Must i place this on a specific directory?
Thanks for the effort
Hello,
I often have this error when I try "connect to"
`IronPython Traceback:
Traceback (most recent call last):
File "C:\Users\Cedric\AppData\Roaming\pyRevit\Extensions\PyRevitMEP.extension\pyRevitMEP.tab\Modify.panel\ConnectTo.pushbutton\script.py", line 100, in
File "C:\Users\Cedric\AppData\Roaming\pyRevit\Extensions\PyRevitMEP.extension\pyRevitMEP.tab\Modify.panel\ConnectTo.pushbutton\script.py", line 79, in connect_to
File "C:\Users\Cedric\AppData\Roaming\pyRevit-Master\pyrevitlib\rpw\db\transaction.py", line 33, in init
Exception: The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone.
Script Executor Traceback:
Autodesk.Revit.Exceptions.InvalidObjectException: The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone.
at Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at IronPython.Compiler.Ast.CallExpression.Invoke2Instruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Scripting.Interpreter.FuncCallInstruction6.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at IronPython.Runtime.Types.LateBoundInitBinder.FastInitSite
1.CallTarget(CallSite site, CodeContext context, Object inst, T0 arg0)
at IronPython.Runtime.Types.PythonType.FastTypeSite1.CallTarget(CallSite site, CodeContext context, Object type, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Microsoft.Scripting.Interpreter.DynamicInstruction
4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Microsoft.Scripting.Interpreter.DynamicInstruction3.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 PyRevitBaseClasses.ScriptExecutor.ExecuteScript(PyRevitCommandRuntime& pyrvtCmd)
I tried to use the fuction, was on search for that for long time.
was confused to see for the first Section created with "Mur None" as name, next section was named "Section 1" and ongoing. I dont know, if this is a bug or only missunderstanding about the functions.
also confusing is, that there is no description, to first select the elements, than go to "CreateSectionFrom"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Versions (please complete the following information):
Here's what my window looks like, and what I was trying to do. Wanted to rotate the angular fitting part with the attached duct selected. Have tried rebooting the PC after the installation, but the error persist. Am I using this tool wrong?
I just installed pyRevit and installed pyRevitMEP automatic through the pyRevit Extension Manager, so I should have the newest version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.