DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.72k stars 632 forks source link

System.IO.Path.CheckInvalidPathChars Chinese region exception #12721

Open ThomasMahon opened 2 years ago

ThomasMahon commented 2 years ago

Dynamo version

Unknow reported by client. cc'd in @yuxinli1994

Operating system

Unknow reported by client.

What did you do?

Run graph using BimorphNodes CAD.CurvesFromCADLayers

What did you expect to see?

Extraction of curves from an ImportInstance.

What did you see instead?

This exception appears to be related to Dynamo's call stack and not BimorphNodes. None of the following methods are from BimorphNodes.

This appears to be a regional issue - the client is running the graph in China.

“illegal characters in path. In System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) In System.IO.Path.GetExtension(String path) In Dynamo.DocumentationBrowser.DocumentationBrowserViewModel.GetResourceNameWithCultureName(String name, CultureInfo culture) In Dynamo.DocumentationBrowser.DocumentationBrowserViewModel.ContainsResource(Assembly assembly, String name) In Dynamo.DocumentationBrowser.DocumentationBrowserViewModel.GetResourceAssembly(Assembly assembly, String name) In Dynamo.DocumentationBrowser.DocumentationBrowserViewModel.LoadContentFromResources(String name, Boolean injectDPI, Boolean removeScriptTags) In Dynamo.DocumentationBrowser.DocumentationBrowserViewModel.HandleLocalResource(OpenDocumentationLinkEventArgs e)”

image

Amoursol commented 2 years ago

@ThomasMahon thank you for passing this one - this appears to be a localization issue. @QilongTang thoughts?

QilongTang commented 2 years ago

@Amoursol Is this a crash? Does not look so from screenshot. Also, the call stacks indicate the path comes with special characters. .Net API could not handle it seems to be the cause, I don't think this is something Dynamo can fix.. I would ask the user to validate the path to Dynamo installation and package installation first.

See Microsoft refrences at https://docs.microsoft.com/en-us/dotnet/api/system.io.path.getinvalidpathchars?view=netframework-4.8

Amoursol commented 2 years ago

@QilongTang indeed not a crash, so I've reverted that!

yuxinli1994 commented 2 years ago

Not really a speciall character though, any thoughts? @QilongTang image

QilongTang commented 2 years ago

@yuxinli1994 @ThomasMahon I think you are confused on this one, the node is in a warning state so I assume users are looking for documentation from the warning bubble for additional information. The error there in the Documentation Browser is only about failure to retrieve documentation due to path failure, but not about failure to run the graph. So it is not equivalent to why the graph did not run and it is not related to your dwg file path. What did the warning bubble say in this case?

yuxinli1994 commented 2 years ago

Hmm, tried to run it again today with the same document,but didn't pop up the warning bubble or any error message. Weird. image

yuxinli1994 commented 2 years ago

but still popped up when try to run it on generic family... Saying modifying is forbidden because the document has no open transcation image

yuxinli1994 commented 2 years ago

but still popped up when try to run it on generic family... Saying modifying is forbidden because the document has no open transcation image @@QilongTang @ThomasMahon

mjkkirschner commented 2 years ago

The transaction issue and the character error in the docs browser are very likely two separate issues.

ThomasMahon commented 2 years ago

Hi @yuxinli1994 can you provide more information on what steps you are taking in the generic model family to cause that exception? If you are running the node in a Generic Model family document that is supported, i.e. you wouldn't see any exception. I've tested it in a Generic Model family and do not see that exception.

yuxinli1994 commented 2 years ago

Sure. just like what I did in project, I created a new generic model family and insert the CAD file using that "Import CAD" option in "Insert" tab. Then I UNLOCK the cad file and used the bimorphNodes.CAD.CurvesFromCADLayers.dyn in dynamo. -> click select model element on the cad file, as for other options, the layers I tried to get is "JG", then run it on manual, the error would pop up. The attached is the files I used, an easy one using the template on Bimorph website. The revit version I used was 2022, dynamo core: 2.12.0.5650 dynamo rvt: 2.12.0.5740 Documents.zip

yuxinli1994 commented 2 years ago

@ThomasMahon

ThomasMahon commented 2 years ago

@yuxinli1994

I've tested in a Generic model family using R2022 and Dynamo 2.12 and It seems to be working. Can you try testing again or let me know if there are any other steps you are taking which might cause this issue?

image