Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Leader not needed

Status
Not open for further replies.

dogarila

Mechanical
Oct 28, 2001
594
How can I remove the leader added by SW when I insert a block, using VB?

Andrew
 
Replies continue below

Recommended for you

What version of SW are you using?

I think that the leader option is defined in the block definition. In SW2001+, the leader option is presented in the Property Manager when you insert the block. DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
 
Forgot this. If you want to remove the leader from a block that is already inserted, just right-click the block and the toggle is available in the Properties of the object. DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
 
dsi,

I know that. What I do is I insert a block attached to a drawing view using a VB program. I would like the block to be inserted without the leader added automatically by SW or use some API commands to remove it after insertion. I couldn't find anything helpful in the SW API help.

Andrew
 
Sorry about that.

That should be controlled by the Annotation::SetLeader2 method. The Annotation Object is a level above the CustomSymbol Object. DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
 
I'm trying to use the following code to eliminate the leader added by SW:

Private Sub cmdXXXX_Click()
Part.InsertCustomSymbol "I:\Solid Works Lib\ATI-SW Data\Mark.sldsym"
Set AView = Part.ActiveView
Set MarkX = AView.GetFirstCustomSymbol
Set XXXXAnn = MarkX.GetAnnotation
junk = XXXXAnn.SetLeader2(0, 0, 0, 0, 0, 0)
Part.ClearSelection
End Sub

I get the following error at line:

Set MarkX=AView.GetFirstCustomSymbol

"Object doesn't support this property or method"

and I don't understand why?

Andrew
 
I'm trying to use the following code to eliminate the leader added by SW:

Private Sub cmdXXXX_Click()
Part.InsertCustomSymbol "I:\Solid Works Lib\ATI-SW Data\Mark.sldsym"
Set AView = Part.ActiveView
Set MarkX = AView.GetFirstCustomSymbol
Set XXXXAnn = MarkX.GetAnnotation
junk = XXXXAnn.SetLeader2(0, 0, 0, 0, 0, 0)
Part.ClearSelection
End Sub

I get the following error at line:

Set MarkX=AView.GetFirstCustomSymbol

"Object doesn't support this property or method"

and I don't understand why?

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor