Dynamo icon indicating copy to clipboard operation
Dynamo copied to clipboard

System.IO.Path.CheckInvalidPathChars Chinese region exception

Open ThomasMahon opened this issue 2 years ago • 13 comments

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

ThomasMahon avatar Mar 22 '22 09:03 ThomasMahon

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

Amoursol avatar Mar 24 '22 13:03 Amoursol

@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

QilongTang avatar Mar 24 '22 16:03 QilongTang

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

Amoursol avatar Mar 24 '22 16:03 Amoursol

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

yuxinli1994 avatar Mar 28 '22 01:03 yuxinli1994

@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?

QilongTang avatar Mar 28 '22 14:03 QilongTang

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 avatar Mar 30 '22 01:03 yuxinli1994

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 avatar Mar 30 '22 01:03 yuxinli1994

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

yuxinli1994 avatar Mar 30 '22 01:03 yuxinli1994

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

mjkkirschner avatar Mar 30 '22 02:03 mjkkirschner

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.

ThomasMahon avatar Mar 30 '22 08:03 ThomasMahon

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 avatar Mar 31 '22 08:03 yuxinli1994

@ThomasMahon

yuxinli1994 avatar Mar 31 '22 08:03 yuxinli1994

@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

ThomasMahon avatar Apr 12 '22 10:04 ThomasMahon