1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Property Data

Discussion in 'Alibre Script' started by idslk, Dec 4, 2019.

  1. idslk

    idslk Alibre Super User

    Hello Mika,
    Take a look into the alibre part data file properties
    upload_2019-12-27_18-24-6.png
    This is the format you have to use in the table.

    I've taken a look and saw you've used empty cells...
    In V01 i was to lazy to catch them...
    Appended is a patch which is capable to handle empty cells.

    Regards
    Stefan
     

    Attached Files:

    Mika likes this.
  2. NateLiqGrav

    NateLiqGrav Alibre Super User

    Might I suggest this alteration of the last few lines.
    Code:
    PropName = ('COMMENT', 'COST_CENTER', 'CREATED_BY', 'CREATING_APPLICATION', 'CREATED_DATE', 'DOCUMENT_NUMBER', 'ENG_APPROVAL_DATE', 'ENG_APPROVED_BY', 'ESTIMATED_COST', 'KEYWORDS', 'LAST_AUTHOR', 'LAST_UPDATE_DATE', 'MATERIAL', 'MFG_APPROVED_BY', 'MFG_APPROVED_DATE', 'MODIFIED', 'PRODUCT', 'RECEIVED_FROM', 'REVISION', 'STOCK_SIZE', 'SUPPLIER', 'TITLE', 'VENDOR', 'WEBLINK')
    ErrorCount = 0
    for prop in range(len(extdesprop_enum)):
      try:
        ThisSession.DesignProperties.ExtendedDesignProperty(extdesprop_enum[prop],str(propertytemplatedata[prop]))
      except:
        ErrorCount += 1
        print('The ' + str(PropName[prop]) + ' property could not be saved. Check that it is formated correctly')
    if ErrorCount:
      win.ErrorDialog( str(ErrorCount) + ' Errors have occured. Please check the Console for more info.\nSome Data had been written into your actual active file!','Error')
    else:
      win.InfoDialog('Data had been written into your actual active file!','Info')
     
  3. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hi Stefan -- JJust to be clear I historically merely typed in a "YYYYMMDD" integer into that "entry" without a problem. -- Lew
     
  4. idslk

    idslk Alibre Super User

    Hello Nate,
    might be ok if you use extdesprop_enum instead of PropName because the enums are read automaticaly instead of typing...
    Therefor the loop: for i in System.Enum.GetValues(ADExtendedDesignProperty): is used ;-)
    The main reason that there is no additional error management and so on is: It is only a "quick techdemo"
    But more or less the code is open and everything could be added if somebody wants to ;-)
    Regards
    Stefan
     
  5. idslk

    idslk Alibre Super User

    Hello Lew,
    see post#18
    Regards
    Stefan
     
  6. NateLiqGrav

    NateLiqGrav Alibre Super User

    Thanks. I see that now. I had assumed that was only the values and not the names.

    Everyone: I believe Alibre uses the Windows Short Date format found (in Windows 7) by going to Control Panel > Region and Language > Formats
     
    Mika likes this.
  7. Mika

    Mika Senior Member

    Yeah, I get it working now. Thank you Stefan.
     

Share This Page