Object Reference

Object Reference

Anonymous
Not applicable
137 Views
2 Replies
Message 1 of 3

Object Reference

Anonymous
Not applicable
I am trying to implement the GetObjectFromName
method of the McadUtility object.

The documentation say that:

"Creating a feature key requires an
McadPart object as a reference."

What is the McadPart object?
What do I put in as the reference?

-Alan Dixon
0 Likes
138 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Hi Alan,

Here is a sample which delete a hole with name "Hole1" and it shows you how
to get McadPartObject reference.

<<<
Sub test()
Dim mapp As McadApplication
Dim util As McadUtility
Set mapp =
ThisDrawing.Application.GetInterfaceObject("Mcad.Application")
Set util = mapp.ActiveDocument.Utility

Dim Pick As McadPick
Set Pick = util.Pick("Select Part", mcPart)

Dim mpart As McadPart
Set mpart = util.GetObjectFromPick(Pick)

Dim holef As McadFeature

Set holef = util.GetObjectFromName("Hole1", mcFeature, mpart)

holef.Delete
End Sub
>>>

Cheers,
Ishwar Nagwani
DCG, Autodesk

Alan B. C. Dixon wrote in message
news:381F5907.648D85B6@psnet.com...
> I am trying to implement the GetObjectFromName
> method of the McadUtility object.
>
> The documentation say that:
>
> "Creating a feature key requires an
> McadPart object as a reference."
>
> What is the McadPart object?
> What do I put in as the reference?
>
> -Alan Dixon
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
Hello Ishwar,

Thanks for the excellent example. Its just what I needed,
and does the job I needed it to do. I really appreciate your
response to my question.

-Alan

Ishwar Nagwani wrote:

> Hi Alan,
>
> Here is a sample which delete a hole with name "Hole1" and it shows you how
> to get McadPartObject reference.
>
> <<<
> Sub test()
> Dim mapp As McadApplication
> Dim util As McadUtility
> Set mapp =
> ThisDrawing.Application.GetInterfaceObject("Mcad.Application")
> Set util = mapp.ActiveDocument.Utility
>
> Dim Pick As McadPick
> Set Pick = util.Pick("Select Part", mcPart)
>
> Dim mpart As McadPart
> Set mpart = util.GetObjectFromPick(Pick)
>
> Dim holef As McadFeature
>
> Set holef = util.GetObjectFromName("Hole1", mcFeature, mpart)
>
> holef.Delete
> End Sub
> >>>
>
> Cheers,
> Ishwar Nagwani
> DCG, Autodesk
>
> Alan B. C. Dixon wrote in message
> news:381F5907.648D85B6@psnet.com...
> > I am trying to implement the GetObjectFromName
> > method of the McadUtility object.
> >
> > The documentation say that:
> >
> > "Creating a feature key requires an
> > McadPart object as a reference."
> >
> > What is the McadPart object?
> > What do I put in as the reference?
> >
> > -Alan Dixon
> >
0 Likes