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

Alibre Script - script requests

Discussion in 'Alibre Script' started by Max, Oct 9, 2018.

  1. oldfox

    oldfox Alibre Super User

    I would like to have a script that would start at the top of the "Constraints" section in the Explorer tree and walk it's way down to the bottom of
    the constraints, changing the numbers to a sequential series for Align, Mate. Those are the most used. I don't rename every constraint but If I did then I would be asking for the same thing but then alphabetical. May be useful for those folks who do rename to words.
  2. HaroldL

    HaroldL Alibre Super User

    Aren't they already numbered sequentially for each type? I think the only time they aren't is when one gets deleted, then there is a gap in the number series.
  3. oldfox

    oldfox Alibre Super User

    Exactly right. But it is very seldom, when I am working on a project with the parts numbering in the hundreds, and the actual model would have
    moving parts, do I not have gaps in the number sequence. Also sometimes I will take an assembly with many parts and break it down to
    sub-assemblies. This would require the deletion of many parts, with constraints, which would delete those constraints leaving the gaps.

    Hopefully I will gain enough wisdom with scripts that someday I may be able write my own.
  4. Lew_Merrick

    Lew_Merrick Alibre Super User

    Actually it sounds to me as if what you need is a Project Planning approach. The MIL-Q-9858 system worked quite well for more than 60 years until the MBA-types were allowed to replace Management with MisManagement. The basis was to create an Installation (the Document that is the top of the Document Tree that brings everything together for the Project. "Beneath" the Installation are: Assemblies, Sub-Assemblies, Sub-Sub-Assemblies, [keep adding Sub-Sub-Sub-Sub- (as required) Assemblies], and Parts (classified as Make or Buy) until the Project is fully defined from a Functional point of view.

    Taking the time to think a Project through pays off quite well. It took the "Harvad MBA" crowd to destroy six decades worth of experience and replace it with the "Charlie Foxtrot" (pretend) "system" we have today.

    My first run-in with a "Harvard MBA type" came while working on a Project I am "not allowed to discuss" at any level of specificity. We set setting up to manufacture involute gear for the Project. The"Harvard MBA type" (who would not allow 90 seconds to pass without claiming this "status") said, "Nobody makes gears, they only but them!" My personal distaste for"Harvard MBA types" has only grown over the years...
  5. oldfox

    oldfox Alibre Super User

    Not really. When I start a new Alibre project, the "project" is already completed. I'm simply turning pen and vellum into something that will drive
    a CNC machine. I already have my own system for what I do and it works quite well.
  6. linehacker

    linehacker Member

    I was recently trying trying to create a timing pulley as shown in:
    Lew was able to point to site which allowed me to create a working GT2 profile pulley dxf for what I was asking about but a script to cleanly create different profiles of timing pulleys directly in Alibre would be great. As noted in the above discussion, other generators like the one in open SCAD used here:
    create too many elements and, at least on my computers, chokes up Alibre. I have not found another solution for other pulley profiles which works. Seems the math is done elsewhere and would not be too complex to convert to a script but not well versed in programing so I can blow smoke and say such things:).
    Anyway, a multi profile (GT2, XL, T5, ect) timing pulley creator script(s?) would be a much appreciated addition to the arsenal of tools available, particularly for us long time hobbyist users of Alibre. Thanks.
  7. VoltsAndBolts

    VoltsAndBolts Senior Member

    Like Linehacker said.

    1) I think you would need to input or select your profile. (GT2, XL, MXL, T5, ect)
    2) Select number of teeth needed.
    3) Select pulley thickness.

    We could then add a shaft hole, flanges, and setscrew boss if needed.

    I usually go to McMaster-Carr and down load the model as a STEP for what I need... Is that cheating? Maybe but it works for me. :rolleyes:
  8. Lew_Merrick

    Lew_Merrick Alibre Super User

    One of the things I do an awful lot of is to generate Libraries of Parts using (what used to be) Wizo Script. I have decided that having anexzternal scripting system serves me better for such a task. The code that modifies Equation Editor values and present the SaveAs name has no real reason to be associated with the generated Part file. More to the point, I am currently undergoing an exercise where I need to SaveAs existing Parts to a customer's internal Part Name" (and modify File Properties->General->Part Data information) for a rather vast number of Parts. I see this is the perfect use for an "External Scripting Lanuage" (as well as needing access to File Properties->General->Part Data) to complete effectively.
  9. Barand

    Barand New Member

    I would like a script that would 'wrap' a bitmap thread image around a cylindrical feature, parallel or tapered, sufficiently to imply an image of a threaded feature. The image being controlled by user input for pitch and length.
    This is one of the most common comments that I receive when presenting a model or an assembly to a client 'isn't that supposed to be threaded?'. I placate them by saying 'it is there but will only show in the drawing, don't worry'. It doesn't stop the disappointment though.
    I then have to cut a thread on every threaded feature to make them happy which makes the files large and laborious to handle and then I have the added grief of working with and remembering to present the view in the drawing correctly by controlling the configurations.
    I use Inventor pro at work and it has this simple feature - all simple folk are happy and I'm able to proceed.
    I've never used python but am looking forward to getting to grips with it and to discover what this new capability can offer.
    Maybe somebody has already done this?
  10. NateLiqGrav

    NateLiqGrav Alibre Super User

    This would be nearly impossible for anyone to implement - except the Alibre crew to implement internally.
  11. Lew_Merrick

    Lew_Merrick Alibre Super User

    My "suggestion" (from nearly a decade ago) is to create (using a contrasting color to the Feature un question) is to create a Cylinder at the Minot Diameter X Length of Thread (on a Threaded Rod) or Major Diameter X Depth (in a Tapped Hole) in the Model and to identify said "Supporting Feature" with the Thread's formal Identification (as defined when the Thread is selected). This would be especially cool could it be "transmitted" through a STEP (ISO-10303) format.
  12. Barand

    Barand New Member

    I like this idea. All we would need in addition is for Alibre to provide a new colour that has graded bands across it. it doesn't necessarily have to spiral to imply a thread like feature.
    many thanks. food for thought!
  13. Lew_Merrick

    Lew_Merrick Alibre Super User

    It is perfectly possible to construct actual Screw Threads in Alibre -- it is just a total waste of time and space! Traditional Drafting Standards give us a means to identify Threads in Drawings and that tradition can merely be "ported" to Modelling. It is that simple.
  14. idslk

    idslk Alibre Super User

    Hello Barand,

    two things, if it is only for optical experience you can use "fake"-thread (trianlge rings as n-times feature copy)
    or you can consider using an other file format (with losing the "parametric"-history)
    Here's a little comparison:
    Barand likes this.
  15. M00m137

    M00m137 Member

    +1 for the file naming scripts, sort of...

    1) I would like a script which allows me to define a default name for an exported pdf file. I want to be able to start with one of the Drawing properties (which I'm pulling from an M-files vault, but I'm not sure that's relevant) and add the filename to the end of it - so I'd end up with a filename "[Drawing No]_[filename], or maybe [Description], which is another property pulled in from M-files.

    2) I would also like to be able to define a default name for Assemblies, which would start "Assembly -"

    I'm not sure if these are really good script options, as I don't want to run them - I just want Alibre to work this way :)

    I would also like a script which set up a new part with xyz sketching planes, on top of the default ones (and probably locked the default ones as this would make them basically redundant), so I can sketch on them and then alter their position. Really miss being able to move sketches from one plane to another in Pro/Engineer.
  16. ajayre

    ajayre Alibre Super User

    You can do this with AlibreScript. Perhaps I can come up with something with a nice user interface...

    MKR likes this.
  17. idslk

    idslk Alibre Super User

    not nice:(but a user interface...:)

    Edit: added the scale option
    win = Windows()
    enviroment = CurrentPart()
    options = []
    values = []
    options.append(['New Sketch on which Plane:', WindowsInputTypes.Plane, None]) # 0
    options.append(['Name for the new sketch:', WindowsInputTypes.String, 'New_copied_sketch']) # 1
    options.append(['Click on sketch to copy\nin Design Explorer:', WindowsInputTypes.Sketch, None]) # 2
    options.append(['Scalefactor in %:', WindowsInputTypes.Real, 150.0]) # 3
    values = win.OptionsDialog('CopySketch', options, 180)
    if values == None:
      print 'Canceled'
    origin_sketch_name = values[2]
    new_sketch_name = values[1]
    sketchbase = values[0]
    scalefactor = values[3]
    new_sketch = enviroment.AddSketch(new_sketch_name,sketchbase)
    Last edited: Apr 30, 2019
    cadtec, MKR and ajayre like this.
  18. ajayre

    ajayre Alibre Super User

    Very nice! I would suggest to make 100% the default scale factor. :)

  19. M00m137

    M00m137 Member

    Wow, thank you! I will go away and try this out. I hate to sound like a grump, but this is not quite the same - in Pro/E I could go back and re-allocate the sketch to a new plane/face, and everything built on that would move along with it without a fuss. I'm guessing I could achieve the same by using your CopySketch script then redefining the extrusion(/rotation/whatever) to point to the new sketch... not sure whether subsequent features (e.g. chamfers, etc.) will also move across seamlessly... guess I'll have to give it a go. But thank you very much for writing it!
    MKR likes this.
  20. M00m137

    M00m137 Member

    Oo! Oo! I've thought of another one.

    Our drawings have a "history table", which includes revision, Change Order, Drawn By, Checked By, Date, and Description. I would like to be able to automatically fill this in. The script would have to:
    Either (a) shift all the current lines in the table down one to make room for the new one (this would involve grabbing all the text is a rectangular area of the drawing and shifting it down a known amount - and then, if the table is full, delete the one which just fell off the bottom), or (b) append the new one to the bottom (I'm willing to have either); it would then have to know the spacings of the table in order to drop the relevant text into the right space (this would be different for A4 and A3 size drawings, although I guess you could have separate scripts for this). Then some of the properties (Change Order, Date, Drawn By, Revision) could be filled in automatically - then it would prompt for the manual entries.

    It's sad how excited I am about the possibility of automating this.

Share This Page