Skip to content

Instantly share code, notes, and snippets.

@AmenJlili
Created November 25, 2021 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AmenJlili/1f794a7c5ea86f6d88cbf4c739f4d47b to your computer and use it in GitHub Desktop.
Save AmenJlili/1f794a7c5ea86f6d88cbf4c739f4d47b to your computer and use it in GitHub Desktop.
public static string GetTitle2(this ModelDoc2 model)
{
var extension = string.Empty;
if (model.GetType() == (int)swDocumentTypes_e.swDocPART)
extension = ".sldprt";
else
extension = ".sldasm";
var title = model.GetTitle();
if (System.IO.Path.HasExtension(title))
return title;
else
return $"{title}{extension}";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment