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

Added support for more types #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sachint2001
Copy link

Added support for around 40 IfcEntity types and subtypes

Added support for around 40 IfcEntity types and subtypes
@sachint2001
Copy link
Author

Hey, a little more detailed explanation of what's been done. We've added support for around 40 types and all of its subtypes (if any). You can view the list in the file ElementType.cs. There are over 200 cases now for the integer input for type. To make the process of choosing the correct type from Grasshopper easy, I have made another component that takes your input in text form of which type you wish to choose and sends the correct number for it to the respective component. You can see the picture below to see how it works.

Ifc Types Test

@paireks
Copy link
Owner

paireks commented Jun 15, 2021

Hey!

Thank you for contribution!

Could you also Commit this additional component for choosing proper enum?

@sachint2001
Copy link
Author

Sure, I'd love to share that component as well. But there was a small issue we faced. In this code in the repository, we are only able to make changes to the backend. Building the solution in Visual Studio does not generate a gha file. Hence, I had to make the component separately.

@paireks
Copy link
Owner

paireks commented Jun 15, 2021

Have you changed the .csproj post-built events, so it fits your machine? This way you should be able to compile also .gha.

I'm using Rider, but I don't think it makes any difference there.

@sachint2001
Copy link
Author

I'll have a look at it and see what I can do

Added a custom component to choose the IfcEntity type and its subtype. Also added a button to enable Ifc file generation only when pressed.
@sachint2001
Copy link
Author

Hey, I've committed the additional component. I've also added another feature of generating IFC files only when pressing a button to do so.

GH TRex 2

@paireks
Copy link
Owner

paireks commented Jun 17, 2021

Hey,

I've tried it, and it looks great. I will need some time to read it more, and reorganize some stuff there, functionality itself is really good.

Do you have some kind of a list of these types somewhere, so I can attach it inside documentation?
I think also that maybe we should just convert a string to an enum in the first component, and this first component would create an object called IfcType with 2 properties: type and subtype, so it will pass this object to Mesh To Elements and Profile To Elements this way, so we could get rid of these integers, what do you think?

Modified MeshToElements and ProfileToElements components to directly accept IfcEntity type as string to choose the types in an easier way.
@sachint2001
Copy link
Author

Hey,

Yes, here is a text file with all the types mentioned.
Ifc Types.txt

I've also modified the MeshToElements and ProfileToElements components to directly take in the strings of the type and subtype to avoid having any extra component for this.

@paireks
Copy link
Owner

paireks commented Jun 21, 2021

Hey, it is better right now, cause there is no redundant integers in between, but still there is too much logic there. Totally this pull request has something like 2000 new lines of code (while the whole project is 1000) just to properly attach the type and subtype, so xBim will recognize it. I think we should find a way to do it without these if statements, I hope we can make it less than 200 lines. One idea is to insist that the user will need to input correct enum for Element Type, so he will need to input a string, for example: "ElementAssembly_AccessoryAssembly" - we will only convert this string to enum automatically. That will remove many lines of code. If you have any other ideas to simplify whole code let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants