-
Notifications
You must be signed in to change notification settings - Fork 34
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
DXF spline import tied to frame settings. Cannot be used headless. #187
Comments
GetDoubleSetting is implemented like this.
You could create a new function in ImportDxf to help you replace project.Frame.GetDoubleSetting(...). Thanks in advance, |
I'll play around with in over the next couple of weeks and find a comfortable pattern. I'm doing a lot of work with DXF import and export for a project and I'm hitting a lot of little limitations that I plan to submit PRs for as I have time to test them. |
Turned out to only take a couple of hours. I used the GlobalSettings class to re-use existing functionality without having to change the signature for the DXF export or make it difficult to set on the user side. In the process I found a bug in SetValue() that wasn't handling DoubleProperties. I added a handler so all DoubleProperties in the GlobalSettings can now be set via code. There might be more missing. When digging into the GlobalSettings structure, I found more references to Project.Frame for properties. Might be worth opening a new issue just to find them and convert them to library-accessible formats. |
On line 533-534, ImportDxf is attempting to get the precision value to approximate a spline:
CADability/CADability/ImportDxf.cs
Line 533 in ddb68c0
It is using Project.Frame.GetDoubleSetting(). In a headless environment, Project.Frame will be null so it is throwing an exception and failing to import the DXF when a spline that triggers this line of code is encountered. It works fine when loading the DXF through CADAbility.App.
I removed the rest of the original comment on troubleshooting this issue as it appears to be a bug in Rider. Program works as expected in Visual Studio when hard-coding the maxError value.
The text was updated successfully, but these errors were encountered: