AnsweredAssumed Answered

SetEntryValue/GetEntryValue C#

Question asked by Todd Carpenter on Jun 2, 2015
Latest reply on Jun 3, 2015 by Todd Carpenter

I don't seem to be able to get this to work.  I'm not quite sure what I'm doing wrong, the code executes with no errors or warnings, but it doesn't seem change anything:

namespace DesignTables.csproj
{
    public partial class SolidWorksMacro
    {
        public void Main()
        {
            IModelDoc2 swDoc = null;
            IDesignTable dt = default(IDesignTable);
            bool boolstatus = false;


            swDoc = ((IModelDoc2)(swApp.ActiveDoc));
            dt = (IDesignTable)swDoc.GetDesignTable();


            boolstatus = dt.Attach();


            dt.EditTable2(true);


            dt.SetEntryValue(3, 2, false, "3");
            dt.UpdateTable(2, true);
            dt.UpdateModel();
            
            string msg = "|" + dt.GetEntryText(2, 1) + "|";
            Debug.Print(msg);
            dt.Detach();


            swDoc.ForceRebuild3(false); 
        }


        /// <summary>
        ///  The SldWorks swApp variable is pre-assigned for you.
        /// </summary>
        public SldWorks swApp;
    }
}

 

Any help would be appreciated...

 

Thanks

Outcomes