Reply

Show/Hide dimensions in assembly

I did some work to put dimensions into model views so I could activate this view or that view, but that doesn't seem to have an API so I can't use it.

 

I need another way to control the dimensions, but I'm not finding that anywhere either so far.  Where is it at?

3 REPLIES

Re: Show/Hide dimensions in assembly

Alan,

 

I filed an IR with GTAC this week about your question. I got a response with a download link to a .zip with some sample code. Unfortunately, it looks like a virus scanner on their end cleansed the .zip and removed the code files. I followed up with an email to GTAC and am waiting on a response. I'll share whatever I get when I hear a response.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Show/Hide dimensions in assembly

Nothing yet?

Re: Show/Hide dimensions in assembly

Alan,

 

See if this will work for you.

 

static void TogglePMI(SolidEdgeAssembly.AssemblyDocument assemblyDocument, bool hidePMI = true)
{
    object PMIObj = null;
    SolidEdgeFrameworkSupport.PMI pmi = null;
    SolidEdgeFrameworkSupport.Dimensions dimensions = null;
    SolidEdgeFrameworkSupport.Dimension dimension = null;

    assemblyDocument.PMI_ByModelState(out PMIObj);
    pmi = (SolidEdgeFrameworkSupport.PMI)PMIObj;

    dimensions = (SolidEdgeFrameworkSupport.Dimensions)pmi.Dimensions;

    for (int i = 1; i <= dimensions.Count; i++)
    {
        dimension = dimensions.Item(i);
        dimension.HidePMI = hidePMI;
    }
}
Jason Newell
Applications Architect
www.jasonnewell.net