-
Notifications
You must be signed in to change notification settings - Fork 37
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
Open Sample Errors on Car Wheel Sample #3958
Comments
Ah interesting! That makes sense, but it does complicate things. In the web we can just override the unit settings if you think that makes sense. In the desktop app, what should we do? Like if I have a project with |
Or transform all raw literals in the KCL to use the unit function in the sample's setting if any unit function is used anywhere within that file? So because the car wheel sample uses an |
how many uses of |
When users import a sample, I'm fine with overwriting their units for that project, perhaps with some message "This project will switch your units to |
There's two. Car Wheel and Wheel Rotor |
Off of the top of my head, this makes me wish that every file could declare at the top which units it uses. This would allow you to import/copy a file from another project, and it would just work, regardless of what units you use. Mixing and matching wouldn't be a problem. Maybe it's not a best practice, but it would help ease friction with remixing. (Sorry, this is in a world where there's actually multiple files...) |
We did have the idea of putting project level settings in a special comment at the top of the files, (eventually including dependencies too). The idea being would help folks share minimal reproducible examples, so that sounds good. |
But at the same time, if there's two usages, maybe we just remove those, instead of implementing a whole new feature to fix this problem. |
I'm liking @jtran's logic that the global units is a config setting in the KCL, that way it carries with the part. |
adding my opinion from slack, ABSOLUTELY DO NOT ABUSE THE
|
in the future with assemblies we could do something like @jtran suggests, but also mixing units among lots of files seems like a bad idea and a source of pain in general, like imagine in our repo we had some analogue of this, it seems insane |
I can read the project settings of the sample and provide warning of the sort @jessfraz is talking about easily. |
Is it common for projects to be in one unit system by default, but then need subsystems or parts within it to use another unit system? Like is it common to have a project assembly in imperial that has one part in metric? Because that points toward needing some part- or file-specific unit definition. |
i like @jtran suggestion but i dont want to add a second way of getting the units for files without really thinking it thru since we will be stuck with it forever, like 1. are we sure we even need that, 2. is there a better way, like lets actually put thought into it, not that @jtran didn't (maybe hes been sitting on this for days) i just dont want to do it as a fast fix response |
because i imagine a scenario where users NEVER use the project settings and instead put inches at the top of every file, like oye... |
Yeah 100% we should think about it for a while. We have a plan for a UX bug fix that requires no deep changes |
For the purposes of this bug, we will overwrite the current user's project settings to match the sample if they don't match the current settings. We'll warn the user on the confirmation step so that they can cancel before they complete the import. |
in most cases i think they'd overwrite, even better, when you load the thing that says "open in new project" tell them about the units then so they can open in a new prohect with those units. |
Absolutely. Let's be careful and think through. I haven't done that yet. The reason it came to me is it's often nice to have everything self-contained in a single file. (There's even been proposals to put Cargo.toml contents in .rs files to make single-file scripts.) But maybe it doesn't apply to units. I don't want the format to encourage bad practices. |
I've broken that out into #3969 |
Description
Using "Open Sample" on samples that use
in()
ormm()
(or equivalent) causes errors. When I opened the Car Wheel sample, I got an error becuase the units were in mm(), but it is expecting inches. We need to also bring in the units along with the sample.Version
v0.25.4
Recordings/Screenshots
The text was updated successfully, but these errors were encountered: