CyrilWaechter / pyRevitMEP

PyRevitMEP - MEP Extensions for PyRevit
GNU General Public License v3.0
57 stars 15 forks source link

usage of RoomToSpace [BUG] #35

Open RichardPinka opened 1 year ago

RichardPinka commented 1 year ago

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:

  1. no matter the questions above, i tried to copy rooms from linked model to my model and ad afterwards i created the spaces (only on one level from more leveled model-building).
  2. I clicked RoomToSpace function
  3. error occured

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.FastInitSite1.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.DynamicInstruction4.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):

Additional context Add any other context about the problem here.

RichardPinka commented 4 months ago

Hello, tested on Revit 2024.
I opened RoomToSpace function window. I did set source attached model, set my target model where i have "new" spaces. I did set parameters to copy from rooms of source model to spaces onto my target model . ..i clicked OK. nothing happened :( I wish this would be repaired image

CyrilWaechter commented 1 month ago

This function would require some better explanations… You actually need to use actual parameter names in your own language. It still require more polish but I confirm it works on Revit 2024.

Little first improvements over here: e5bd72c

RichardPinka commented 1 month ago

Dear Cyril. Thank You for the response and interest to solve this. I confirm, that on my version (actual updated version of 2024.3) nothing happened . I think last time i tested it on my home destkop. Now i am testing in office desktop... generalry i may test it on 6 different desktop workstations in case needed. Nothing happens after i clicked on OK after inputs set according the window below. I am not sure what are you talking about regarding "parameter names in my own language". I generally always use english installation of revit and also the ENG language, setting before starting.
So How can i use my language parameters name ? ps.: i have lot of rooms in attached building object. I just tested this case only on one floor where i created the spaces (in no other floor of my model are newly created spaces) What I am doing wrong ?

image

CyrilWaechter commented 1 month ago

Hello @RichardPinka, I see the issue in your input. The example fouled you. The «%» sign should not be place before the parameter name or separator. Please update pyRevitMEP and try with following in Snowdown Towers Sample HVAC: Source input:

Number  -   Name
n°  Number  | name:     Name

Target:

Comments
Name

You should see it working as expected.

I hope usage will be more clear now.

RichardPinka commented 3 weeks ago

Hello Cyril, Finally, i undrerstood how should i use this.. unfortunatelly, description and for me useless «%» sign gave me just confusion, to be honest. OK, in the "test model" that function works, perfect. Unfortunatelly, in real-life model, which i am actually work with, it is not working. It seems more complicated.. why ? I am not sure to be honest. But i know, there is important to know from where revit shows the "alternative" parameters of attached model´s room data (e.g. name, number) ... i see in my situation that data from where my space sucks data from are "unnocupied" (second picture below) but actual room data are in different model (first picture). Architects created models topology like this, and all of it is part of the room geometry creation of rooms created in one of the models below :

1 2

... NEITHER setting of all sub-attached models into attached models to "ATTACHMENT" instead of "OVERLAY" did not help if you would like to see the models i may send them

RichardPinka commented 3 weeks ago

Hello @CyrilWaechter , I am testing the function on different model, where not three but just two models of building i do attach to my hvac model. (these are architectural and structural model). There was partially success. I was able to copy data from ordinary attribute "Name" "Number" (hurray!) but, newly created attribute "Označení bytu" (flat mark) cannot be copied to some ordinary attribute, e.g. "Comments" image

also, haven´t been able to paste data to newly created my own parameters such "ID_PRVKU" or "OBECNÝ KOMENTÁŘ" image image

you may see their existence in my model here: image

CyrilWaechter commented 2 weeks ago

Hello @RichardPinka,

About your first reply:

In your case I do not see any reason to not be able to find the room. You can send me your models by email for privacy (use swisstransfer or something like that).

About your second reply it is probably a character encoding issue as TextBox.Text is UTF-16 and the rest is utf-8. I found a way to avoid this issue (see: https://github.com/CyrilWaechter/pyRevitMEP/commit/cb97cf4bdca32fd8145f8e7e10859e852c20a459). Please update pyRevitMEP.