Skip to main content
1-Visitor
April 5, 2016
Solved

Why model.GetDescr().GetPath() in Jlink API doesn't include the root (C: or E: or D:) in the path?

  • April 5, 2016
  • 1 reply
  • 1697 views

For example, for drawings from "C:\myFolder\myProject" or  "E:\myFolder\myProject" the function model.GetDescr().GetPath() retrieves only "\myFolder\myProject" and omits the drive letter or the root folder.

I would need the full path to differentiate if the file is from Local disk or Removable disk.

Best answer by MarkStallard

I haven't used Model.GetDescr in JLink, as far as I know.

For example, for drawings from "C:\myFolder\myProject" or  "E:\myFolder\myProject" the function model.GetDescr().GetPath() retrieves only "\myFolder\myProject" and omits the drive letter or the root folder.

I would need the full path to differentiate if the file is from Local disk or Removable disk.

Model.GetDescr returns a ModelDescriptor object. The method ModelDescriptor.GetDevice might give you the drive letter. You could try ModelDescriptor.GetFullname.

|+|  M a r k  |+|

1 reply

1-Visitor
April 5, 2016

I haven't used Model.GetDescr in JLink, as far as I know.

For example, for drawings from "C:\myFolder\myProject" or  "E:\myFolder\myProject" the function model.GetDescr().GetPath() retrieves only "\myFolder\myProject" and omits the drive letter or the root folder.

I would need the full path to differentiate if the file is from Local disk or Removable disk.

Model.GetDescr returns a ModelDescriptor object. The method ModelDescriptor.GetDevice might give you the drive letter. You could try ModelDescriptor.GetFullname.

|+|  M a r k  |+|

1-Visitor
April 5, 2016

That is helpful, thank you!