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 at 3:10 PM.

  1. idslk

    idslk Alibre Super User

    Hello colleagues,

    here is a short demo of what i've been waiting for...
    With 2019 SP2 it works...
    Here is a little quick and dirty script to read a *.xlsx file and write the data into your actual session property datas...
    The *.xlsx file has to have one sheet with the following structure:

    upload_2019-12-4_21-50-55.png

    ofcourse the data from B2 to B25 should hold your informations ;-)

    You don' have to fill all 24 cells, you can leave blanks...
    You have to have the string "Propertydatafile" in B1 it's a quick check for the "right" file...

    You can try this at home on your own risc:D As ever: for first tests don't use important files of your business!
    Open alibre freshly, create a new simple file(part) and than try the script...

    upload_2019-12-4_22-4-12.png
    You will be promted to choose the data file
    upload_2019-12-4_22-1-28.png
    a file requester will appear...
    upload_2019-12-4_22-7-51.png
    and than it's quickly done...
    upload_2019-12-4_22-2-36.png

    Regards
    Stefan

    PS.: it would be nice to get some feedback from you...maybe the script will get some nicer look and a little bit more comfort...
     

    Attached Files:

    Last edited: Dec 4, 2019 at 4:56 PM
    TimoCAD likes this.
  2. albie0803

    albie0803 Alibre Super User

    Would this info get saved to vault or does vault values replace/over-ride them?

    Maybe I should try it tomorrow at work? :rolleyes:
     
  3. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hi Stefan -- Whereas I admit to hating the File Properties->Generasl->General listing of values your "offering" (hopefully) provides a way for users to "customize" things better. I am attaching the (xlsx) spreadsheet I have created in this attempt. I get error messages and failure when I attampt to use it, so "more instructions" are probably needed (at least by me). -- Lew
     

    Attached Files:

  4. idslk

    idslk Alibre Super User

    Hello Lew,
    i've opened your file...
    You have changed the structure...
    Maybe i will add some "comfort" functions later, but for now the structure of th range A1:B25 should stay.
    The other areas of the sheet can be used for additional informations. More sheets are not tested -> see under "comfort"...
    And if you like the word or not, B1 should not have any other content than "Propertydatafile" - which means: no spaces no capital no... only "Propertydatafile".

    Regards
    Stefan
     
    Last edited: Dec 5, 2019 at 1:16 PM
  5. idslk

    idslk Alibre Super User

    Sorry, i do not have the vault installed so i haven't tested it. As the values are put into the standard place they will be saved with the part and this should behave the same as you write the values by had into the properties. So if values in this place are normally transfered to the vault, they should behave the same with the script...
    Trying this at work? Hm? Not the best idea i think. Maybe after some testing this will be ok...but not yet...

    Regards
    Stefan
     
  6. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hi Stefan -- I had assumed that "Property Data File" would be an "equivalent" as many of the groups I do work for are somewhat "anal retentive" on such subjects. Similarly I have been creating "multisheet spreadsheets" since 1983 and is something I do without thought. The Revision Offset value increments the "Revision ID" through the (American) identifiers for chaned "Levels of Revisaion" (through change level "EZ"). Here is an update that I do hope fixes things... -- Lew
     

    Attached Files:

  7. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hi Stefan -- I suspect that the *.xlsx file is required to have a name such as "Propertydatafile." My thought is that it should be "named" the same as the Part or Assembly file to be used to "update" things as changes are made. The attached ZIP file shows some of the work (partial -- by no means complete) I am working towards a "Project File Spreadsheet" system. Eventually I would have a "File Properties-> General->General" spreadsheet for each component within a Project. ??? -- Lew
     
  8. idslk

    idslk Alibre Super User

    Hi Lew,
    please change the cells with red text:
    upload_2019-12-5_23-45-57.png
    The datum cells have to have the date format your system is using eg. 2019.04.12 including the seperator points! (in the screenshot they are german...)
    All value cells should have the cell format "Text (@)" (for B1:B25)
    In coloumn C:C i've filled in the names used in the property editor only for guidance...

    This is the result after running the script using your "changed" data file:
    upload_2019-12-5_23-47-24.png

    If i get more comments for the community, i'll thing about the comfort functions...such as supporting multiple sheets identified with the project as the sheetname and so on and on...

    Regards
    Stefan
     
  9. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hi Stefan -- Ah, I am starting to see. 50+ years of performing work for various agencies of the US government has left me "dating" things as YYYYMMDD. [I often add an A,B,C,D... to the end of the YYYYMMDD value so as I know which one came when during the day.] What mind??? -- Lew
     
  10. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hi Stefan -- Almost like I knew what I was doing!!! -- Lew
     

    Attached Files:

  11. idslk

    idslk Alibre Super User

    Hello Lew,
    seems to work at your side :)
    Are there any wishes?
    I had a "non script"-"stand alone"-Version (exe) at the time the Alibre API wasn't updated which looed like this:
    upload_2019-12-6_17-27-49.png

    Regards
    Stefan
     
    TimoCAD likes this.
  12. TimoCAD

    TimoCAD Senior Member

    Hi Stefan, what about concatenating Properties for the FileName before saving? :) Maybe a little "AlibreDesign-EDM-Software" like "Solid works-Explorer" is born that way... ;)
     
  13. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hi Stefan -- Attaced is a "lessons learned" document I created shortly after Andy added "spreadsheet access" to the (then) WizoScript. I am not all that great of a "coder" and write up "lessons learned" documents to keep such things at my fingertips.
     

    Attached Files:

  14. idslk

    idslk Alibre Super User

    Hello Lew,

    looks like the first step to success ;-) and as you've written AlibreScript "uses" (/can use) openpyxl.
    There is an extended description under openpyxl ...
    If you want to control the data area using a sheetname it will be simply possible, the way using a cell was only a simple check and reminder for the user to take the right file...
    You want to see something added?

    Regards
    Stefan
     
  15. idslk

    idslk Alibre Super User

    Hello Timo,
    the thought behind the little script was to take a spreadsheet and fill in the known values for the property fields and save them for reuse in the same project.
    So if i create a new part or assembly i call only the script an data such as "created by", "creating application" or "recieved from" will be populated very quick.
    The data itself is copied into the properties and so will be saved with your part/assembly...
    So you will have only one "project specific"-xlsx-file for the intended use. It is possible to blow the script up with little things...let's have a look and as i wrote
    ;)
    Regards
    Stefan
     
  16. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hi Stefan -- Whereas I have been "coding" since the days of "binary assembler code" I am not that good a "coder." [I reached the "almost good" class in the mid-1970's with FORTH.] Having worked with people usch as Arne Henden and Dennis Ritche, I know what "good coding" looks and works like and know that such terms do not apply to me. However, I am decently good at assembling systems and documenting them. Attached is an old (2016) document on Part Data I "suggested." -- Lew
     

    Attached Files:

Share This Page