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

Accessing "Show Reference Geometry" from script ?

Discussion in 'Alibre Script' started by ThomasP, Aug 2, 2020.

  1. ThomasP

    ThomasP New Member

    When creating assemblies I frequently turn on and off the "Show Reference Geometry" option for parts and subassemblies to get robust references for the different assembly constraints.
    After a while doing that the amount off shown references can make it very cluttered and difficult to handle.

    To fix that I am trying to create a script that iterates through all the assembly components and turn off the "Show Reference Geometry".

    I have searched the script reference I have but unfortunately I not yet been able to find any information about that function.
    I am thinking something like this:

    #iterate through all parts in an assembly and it's sub-assemblies
    def IteratePartsInAssembly(A):
    for P in A.Parts:
    #print ' Part %s (in %s)' % (P.Name, A.Name)
    SetReferenceGeometryVisibility(P, false)
    for SA in A.SubAssemblies:
    #print " Subassembly %s (in %s)" % (SA.Name, A.Name)
    SetReferenceGeometryVisibility(SA, false)

    #set the objects "Show Reference Geometry" option
    def SetReferenceGeometryVisibility(object, visibility):
    object.??????????????? = visibility

    Anyone knows where to find information about this?

  2. NateLiqGrav

    NateLiqGrav Alibre Super User

    I do not see any way to do this currently.
  3. DavidJ

    DavidJ Alibre Super User Staff Member

    One option to try - Shift select all items in the Design Explorer, then right click, and 'Show Reference Geometry' (if any reference geometry is showing it will be hidden). Probably quicker than selecting a script. Alt+0 is an alternative toggle command for reference geometry - so that would be select all, Alt+0.
    NateLiqGrav and jfleming like this.
  4. DavidJ

    DavidJ Alibre Super User Staff Member

    Actually - even simpler

    Ctrl+A , followed by Alt+0
    NateLiqGrav likes this.
  5. NateLiqGrav

    NateLiqGrav Alibre Super User

    Proof of Cunningham's Law - which states "the best way to get the right answer on the internet is not to ask a question; it's to post the wrong answer."

    It went unanswered for 10 days until I posted one sentence.

    Though technically I was correct that there is no way to turn on or off "show reference geometry" in Alibre Script or the public API.
    oldfox and simonb65 like this.
  6. Lew_Merrick

    Lew_Merrick Alibre Super User

    Hi Nate -- I guess that my argument might run more along the line of: "Geometry (Reference or Otherwise) should be "accessible" to all Parts from within an Alibre Script "reach." Obviously this implies that you are following some kind of convention in terms of the "naming" of said Geometry, right? -- L:ew
  7. ThomasP

    ThomasP New Member

    Ok, thanks for all input.
    I now understand that the possibility I was looking for just don't exist.
    (The idea was to start with a script and if it turned out well I was planning to "promote" it to an add-on, exposing it under the "Add-on" tab making it a one- or two-click operation)

Share This Page