×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

API inset hole table

API inset hole table

API inset hole table

(OP)
I've written a macro that insterts a hole table as part of a bigger program that I'm working on.
The issue is I want to hide the table after it is inserted but have the origin shown.
I can't seem to find the code to do that.
Below is the code to insert the table any help would be appreciated.

CODE

Sub test_table()
Dim swapp As SldWorks.SldWorks
Dim swView As SldWorks.View
Dim swmodel As SldWorks.ModelDoc2
Dim swselmgr As SldWorks.SelectionMgr
Dim swHoleTable As SldWorks.HoleTableAnnotation
    Set swapp = CreateObject("SldWorks.Application")
    Set swmodel = swapp.ActiveDoc
    Set swselmgr = swmodel.SelectionManager
    Set swView = swselmgr.GetSelectedObjectsDrawingView(1)
    Set swHoleTable = swView.InsertHoleTable(0, 0.036051, 0.082461, 1, "C:\SolidWorks2008\SolidWorks\lang\english\standard hole table--numbers.sldholtbt")
End Sub

RE: API inset hole table

After your "Set swHoleTable =..." line, you need:

CODE

Dim swDatumOrigin as SldWorks.DatumOrigin
Set swDatumOrigin = swHoleTable.HoleTable.DatumOrigin
swHoleTable.GetAnnotation.Visible = swAnnotationHidden
swDatumOrigin.GetAnnotation.Visible = swAnnotationVisible

 

-handleman, CSWP (The new, easy test)

RE: API inset hole table

(OP)
Handleman you are a lifesaver.

It works great thanks.

RE: API inset hole table

CODE

Set swHoleTable = swView.InsertHoleTable(0, 0.036051, 0.082461, 1,(snip)

Is this line setting the insertion point for the table?  Does the table template need to have the "attach to anchor toggled off?  Just curious.

Joe
SW Office 2008 SP3.1
P4 3.0Ghz 3GB
ATI FireGL X1

RE: API inset hole table

(OP)
Yes that inserts the hole table.
It doesn't have to but I don't have a anchor point set so I would rather let the user position it wherever they need it to be.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources