Ask and answer engineering questions

Learn from millions of experts

Missing feed

How to use iLogic to return a filename?

By Lee Schneider on 28 Feb 15:17 5 answers 0 comments

I am having trouble using iLogic in a drawing template to retrieve the filename of the model (without the extension) for insertion in a title block and to use to populate the iProperties Part Number field.

5 answers

  • Ioannis Skarlatakis
    Ioannis Skarlatakis over 4 years ago

    Hi Lee,
    Could you share your code to check it ???
    or you still try to figure out what to write !!!


  • Lee Schneider
    Lee Schneider over 4 years ago

    I am trying to leave the Part Number iProperty blank until a drawing is created at which point the Part Number automatically populates as the model filename minus the extension. The following code works, but I can't figure out how to drop the extension.

    'Exit rule If no Part or Assembly Is in the drawing yet

    If (ThisDrawing.ModelDocument Is Nothing) Then Return

    'get the file name of the doc the drawing points to

    modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)

    iProperties.Value(modelName,"Project", "Part Number") = modelName

    'update the drawing

Add your answer to: "How to use iLogic to return a filename?"

Save Cancel