Thanks. I think this video is quite slow in comparison to my others. I try to make my videos as short and concise as possible, but sometimes I overdo it with editing and it becomes a bit faster that I wanted to. Still learning how to do better videos ;)
Great Videos man. wish I could afford your course. Anyway I'm trying to place a beam using this code but I get this error. Exception : System.MissingMemberException: 'type' object has no attribute 'ValueProvider'. All I changed was in the last step before commit ..., StructuralType.Beam)
Hey, It's hard to debug without the code, but have a look here learnrevitapi.com/python-snippets Search for 'Create Beam' In general when we create elements it's about what type of element placement does family has. (Point Based, Line Based)
Thanks. Great Tutorial. Symbol = get_Type_by_name(' Placeholder - Type A') , I am bit confused there. How we get to know that we need to write "get_Type_by_name"
Timestamp in the video would be helpful since I made it long time ago. I think you reffer to my function to get all Types with matching name. In my case I wrote a function to get a type of element with exact match that I am writing there. So if my Type that I want to get had a name of 'RANDOM_NAME_ABC' then that's what I would need to write. Also if multiple families have this type, then I would get all of them, so need to account for that too. You can see code for this function also on my blog, but I am sure I showed it during the video as well. CZcams is blocking external links so search in google for : Revit API: Get Elements or Types by Type/Family name. There is article on my learnrevitapi website.
in Revit API types have to be activated if they weren't used in the project before. FamilySymbol Class has Activate method. You can check if it was activated already with IsActive Property. You just call it on your type before you use it. Or as a dirty workaround, you can manually place an instance of that specific type in Revit and it will be activated. But I would recommend using Revit API, it's not complicated step!
If it's possible to do it manually in Revit, then most likely there is a way to do it with Revit API. I am not sure I would place hosted elements on elements in linked model. I imagine if you unload Revit link, you might encounter a lot of warnings/errors because of it.
Yes, you can use any IDE, but process setting up Revit API Autocomplete will be different. So try to search if any guide on Sublime is available. Regarding libraries - There are plenty of useful packages already included in pyRevit environment and you can see them in pyRevit GitHub / site-packages folder. I always try to not use any other packages so people can follow my tutorials and code. You could also add your own packages, I would ask on pyRevit forum to see what's the best practice. Or just drop packages in site-packages folder (in AppData/pyRevit...) to test it, and then you probably could make it work if you place it in your lib folder. P.S. Remember, we never execute code in pyCharm/Sublime or any other IDE, it's used just for writing code, but it can only be executed from inside of Revit (RevitPythonShell, Dynamo, pyRevit...)
I used to have a script about creating DirectShapes, but I think I lost it when I accidentally deleted my development scripts... As far as I remember we first needed to create geometry itself, and then apply that geometry to a DirectShape instance to make it an actual object in Revit project. I used to play with boxes, but there should be a method for creating a sphere, at least I would expect it exists. I would also recommend looking into creating Component In-Place. Direct Shape are not very good elements to work with in Revit in my experience, so maybe it's worth exploring it as well. Happy Coding!
Hello, i watched your video, and i think maybe you can help me to solde my problem. my question about a plug-in for picking a family window and placing it on the wall of Revit by using an user interface, python and C# i'm facing this kind of error, : "Value cannot be null. Parameter name: symbol". in familysymbol, i try using methode NewFamilyInstance to pick one of the type window in revit that i insert before. Actually, I think that my error come from the win_type variable used to create the window family is null at this time. Do you know how to handle with this kind of error? i try several solutions but still not find the best.
HI Toan, It seems to me that you didn't get the right symbol. It tells you that symbol argument can not be null, meaning variable that you provided does not have a ValidObject. Try to print all your arguments before you create a window for debugging purposes. I am quite sure that you will notice that you are not getting any symbol.
@@ErikFrits hi, thanks for your response. i can finally find a solution for that. Actually, i'm facing another challenge. after selecting the wall, there is another UI displayed to choose the "number of instances to place" , where I wanted to add the 2 textbox height and width for modifying the dimensions of the windows according to the values entered by the user for the parameters "height" and "width" in "dimensions". Do you know what i mean? You think it's possible?
@@toannghiale8064 if you use pyRevit then have a look at rpw.FlexForm. It will allow you to quite esily make a form with custom components. You can just make a few TextBoxes to get user input. I have shown an example in the end of Randomize Parameter Values video czcams.com/video/aVS1v2DLoQc/video.html
@@ErikFrits great video, i really appreciate that. Actually, by regarding your video, i can modify some family parameter of windows but i'm facing now a problem that i can't use python to modify "built-in parameters" in window's family like "Height" and "Width". They are predefined in Revit and have a specific name and meaning. Can you have a solution for that?
I am trying the same example when creating a wall using Wall.Create method but i got an error " ArgumentsInconsistentException : Curve length is too small for Revit's tolerance (as identified by Application.ShortCurveTolerance)"
It says that your curve is too short. Try to print your start and end points coordinates, so you might see an error in there. Maybe you using the same point as start and end ?
CZcams comment system is broken. I also often miss comments because I never get notifications...😪 Send it in my LinkedIn, that woupd be easier and quicker.
📘 Master Getting Elements with Revit API +: Python (1$+)
www.erikfrits.com/ebook
We find a huge amount of wonderful information in every video 💜💙💚
Thanks, that's awesome.
Happy Coding!
Thank you very very much .. your videos are very informative .. May Allah guide you and give you from where you don't count
Thanks!
Happy to help where I can ;)
thank you this video is very helpful
Glad it was helpful!
Thanks for another great video, this helps navigating the Revit API site. It was a bit daunting the first time I visited.
Thanks Ian!
It will feel more natural after you spend more time there. I hope I managed to fast track it a little ⏩
Very Usefull , Thank you for sharing
Thanks 👐
Thank you.
Happy to help
Sessions are very informative, I would suggest will you go little slowly to make understand to align with the common person's capability
Thanks.
I think this video is quite slow in comparison to my others.
I try to make my videos as short and concise as possible, but sometimes I overdo it with editing and it becomes a bit faster that I wanted to.
Still learning how to do better videos ;)
Great Videos man. wish I could afford your course. Anyway I'm trying to place a beam using this code but I get this error. Exception : System.MissingMemberException: 'type' object has no attribute 'ValueProvider'.
All I changed was in the last step before commit ..., StructuralType.Beam)
Hey,
It's hard to debug without the code, but have a look here
learnrevitapi.com/python-snippets
Search for 'Create Beam'
In general when we create elements it's about what type of element placement does family has. (Point Based, Line Based)
Thanks. Great Tutorial. Symbol = get_Type_by_name(' Placeholder - Type A') , I am bit confused there. How we get to know that we need to write "get_Type_by_name"
Timestamp in the video would be helpful since I made it long time ago.
I think you reffer to my function to get all Types with matching name. In my case I wrote a function to get a type of element with exact match that I am writing there. So if my Type that I want to get had a name of 'RANDOM_NAME_ABC' then that's what I would need to write. Also if multiple families have this type, then I would get all of them, so need to account for that too.
You can see code for this function also on my blog, but I am sure I showed it during the video as well.
CZcams is blocking external links so search in google for : Revit API: Get Elements or Types by Type/Family name. There is article on my learnrevitapi website.
Hi Erik, i have a question... when i create the window i see an error "The symbol is not active" can you help me with this error?
in Revit API types have to be activated if they weren't used in the project before.
FamilySymbol Class has Activate method.
You can check if it was activated already with IsActive Property.
You just call it on your type before you use it.
Or as a dirty workaround, you can manually place an instance of that specific type in Revit and it will be activated. But I would recommend using Revit API, it's not complicated step!
very nice video, I just wondering if it possible to insert hosted element that will be host on link model ?!
If it's possible to do it manually in Revit, then most likely there is a way to do it with Revit API.
I am not sure I would place hosted elements on elements in linked model. I imagine if you unload Revit link, you might encounter a lot of warnings/errors because of it.
@@ErikFrits I did it ! and Thanks alot Erik for interesting to help ❤️🙏
Nice! can we use sublime.text to program ? and can we use python's libraries in your code??
Yes, you can use any IDE, but process setting up Revit API Autocomplete will be different. So try to search if any guide on Sublime is available.
Regarding libraries - There are plenty of useful packages already included in pyRevit environment and you can see them in pyRevit GitHub / site-packages folder. I always try to not use any other packages so people can follow my tutorials and code.
You could also add your own packages, I would ask on pyRevit forum to see what's the best practice. Or just drop packages in site-packages folder (in AppData/pyRevit...) to test it, and then you probably could make it work if you place it in your lib folder.
P.S. Remember, we never execute code in pyCharm/Sublime or any other IDE, it's used just for writing code, but it can only be executed from inside of Revit (RevitPythonShell, Dynamo, pyRevit...)
@@ErikFrits thanks a lot!! from Peruu!
Hey 👋Can you help me to create a sphere on revit
What do you mean?
Are you trying to create a Sphere with DirectShape or you have a family of a sphere?
@@ErikFrits I don't have a family of a sphere , but I've tried to create it with DirectShape
I used to have a script about creating DirectShapes, but I think I lost it when I accidentally deleted my development scripts...
As far as I remember we first needed to create geometry itself, and then apply that geometry to a DirectShape instance to make it an actual object in Revit project. I used to play with boxes, but there should be a method for creating a sphere, at least I would expect it exists.
I would also recommend looking into creating Component In-Place. Direct Shape are not very good elements to work with in Revit in my experience, so maybe it's worth exploring it as well.
Happy Coding!
Hello,
i watched your video, and i think maybe you can help me to solde my problem.
my question about a plug-in for picking a family window and placing it on the wall of Revit by using an user interface, python and C#
i'm facing this kind of error, : "Value cannot be null. Parameter name: symbol". in familysymbol, i try using methode NewFamilyInstance to pick one of the type window in revit that i insert before.
Actually, I think that my error come from the win_type variable used to create the window family is null at this time.
Do you know how to handle with this kind of error? i try several solutions but still not find the best.
HI Toan,
It seems to me that you didn't get the right symbol. It tells you that symbol argument can not be null, meaning variable that you provided does not have a ValidObject.
Try to print all your arguments before you create a window for debugging purposes. I am quite sure that you will notice that you are not getting any symbol.
@@ErikFrits hi, thanks for your response. i can finally find a solution for that.
Actually, i'm facing another challenge.
after selecting the wall, there is another UI displayed to choose the "number of instances to place" , where I wanted to add the 2 textbox height and width for modifying the dimensions of the windows according to the values entered by the user for the parameters "height" and "width" in "dimensions". Do you know what i mean?
You think it's possible?
@@toannghiale8064 if you use pyRevit then have a look at rpw.FlexForm. It will allow you to quite esily make a form with custom components. You can just make a few TextBoxes to get user input.
I have shown an example in the end of
Randomize Parameter Values video
czcams.com/video/aVS1v2DLoQc/video.html
@@ErikFrits great video, i really appreciate that.
Actually, by regarding your video, i can modify some family parameter of windows but i'm facing now a problem that i can't use python to modify "built-in parameters" in window's family like "Height" and "Width". They are predefined in Revit and have a specific name and meaning.
Can you have a solution for that?
@@ErikFrits hi
czcams.com/video/BCbw-qHLqGc/video.html
do you have the same video like this one but for python?
I am trying the same example when creating a wall using Wall.Create method but i got an error " ArgumentsInconsistentException : Curve length is too small for Revit's tolerance (as identified by Application.ShortCurveTolerance)"
It says that your curve is too short.
Try to print your start and end points coordinates, so you might see an error in there.
Maybe you using the same point as start and end ?
test COMMENT
test REPLY? 😅
@@ErikFrits I dont know why i can' comment in our last discusison with the link of github
Can i send it to you by email?
CZcams comment system is broken. I also often miss comments because I never get notifications...😪
Send it in my LinkedIn, that woupd be easier and quicker.
i send you a messge in LinkedIn.