Trouble using keywords in PICK method with MDT5

Trouble using keywords in PICK method with MDT5

Anonymous
Not applicable
292 Views
10 Replies
Message 1 of 11

Trouble using keywords in PICK method with MDT5

Anonymous
Not applicable
I can't get the pick method to except keywords. It keeps returning "invalid
entity" when I enter a keyword.

Any ideas?
0 Likes
293 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable
Hi Wayne,

The following works for me (assuming your already connected to Acad/MDT).

Dim oMCADUtility As McadUtility
Dim oUserPick As McadPick
Dim oPickPart As McadComponent

Set oMCADUtility = oMCADApp.ActiveDocument.Utility
Set oUserPick = oMCADUtility.Pick("Select Part", mcComponent)
Set oPickPart = oMCADUtility.GetObjectFromPick(oUserPick)

Its probably the mcComponent (in the example) that's fouling you up. As far
as I know the "CreatePickObject" method is still broken. If your trying to
iterate through a selection loop and re-using a single pick, you've got your
work cut out for ya. I get power exits everytime I use that method. As far
as I can tell its the only way to make a single pick and then re-use the
pick to select a different object. I hope someone else has a better answer.

Gary
0 Likes
Message 3 of 11

Anonymous
Not applicable
Gary,

Your example does not show the use of keywords. I have attached a sample
of the code I am having trouble with.

The actual error I'm getting is, "Instance does not exist." The error occurs
when I try entering a keyword. The command doosn't want to except keywords.
This doesn't kill the command however.

Thanks for your help.

Wayne

"Gary McMaster" wrote in message
news:65CB27EA889586E58E47AE72B57F9599@in.WebX.SaUCah8kaAW...
> Hi Wayne,
>
> The following works for me (assuming your already connected to Acad/MDT).
>
> Dim oMCADUtility As McadUtility
> Dim oUserPick As McadPick
> Dim oPickPart As McadComponent
>
> Set oMCADUtility = oMCADApp.ActiveDocument.Utility
> Set oUserPick = oMCADUtility.Pick("Select Part", mcComponent)
> Set oPickPart = oMCADUtility.GetObjectFromPick(oUserPick)
>
> Its probably the mcComponent (in the example) that's fouling you up. As
far
> as I know the "CreatePickObject" method is still broken. If your trying to
> iterate through a selection loop and re-using a single pick, you've got
your
> work cut out for ya. I get power exits everytime I use that method. As far
> as I can tell its the only way to make a single pick and then re-use the
> pick to select a different object. I hope someone else has a better
answer.
>
> Gary
>
0 Likes
Message 4 of 11

Anonymous
Not applicable
Wayne,

I tried your example, and many variations thereof, and couldn't get it to
work either. It certainly doesn't seem to work as described in the help.
Maybe it's a side effect of the broken CreatePickObject method. It seems to
follow that the Pick method would make use of the CreatePickObject method,
at least in part.

Gary
0 Likes
Message 5 of 11

Anonymous
Not applicable
Thanks for help. Do you know another place where I can dirrect this issue?

Wayne

"Gary McMaster" wrote in message
news:E53697E1950CCB70BADC0FA148D507BE@in.WebX.SaUCah8kaAW...
> Wayne,
>
> I tried your example, and many variations thereof, and couldn't get it to
> work either. It certainly doesn't seem to work as described in the help.
> Maybe it's a side effect of the broken CreatePickObject method. It seems
to
> follow that the Pick method would make use of the CreatePickObject method,
> at least in part.
>
> Gary
>
0 Likes
Message 6 of 11

Anonymous
Not applicable
I wish I did. I often run into similar problems. If I can't get an answer
here, or in the help file, I try plan "B".

Gary
0 Likes
Message 7 of 11

Anonymous
Not applicable
What's plan "B"?

"Gary McMaster" wrote in message
news:0BD44B8254CD63DF4F84D513F0064122@in.WebX.SaUCah8kaAW...
> I wish I did. I often run into similar problems. If I can't get an answer
> here, or in the help file, I try plan "B".
>
> Gary
>
0 Likes
Message 8 of 11

Anonymous
Not applicable
Whatever hacked workaround I can come up with.
0 Likes
Message 9 of 11

Anonymous
Not applicable
Guys

I may be missing the issue, but I just started a new drawing made a default
part, loaded the dvb, and run it. At the prompt I typed in Part1_1 and it
returned successful. Is that what you were trying to get?

--
Kent Keller

Check out the Mechanical Desktop FAQ @
http://mymcad.com/
"W Massey" wrote in message
news:793BBACB1F3F6C8367C7CCB3DBD82A03@in.WebX.SaUCah8kaAW...
> Gary,
>
> Your example does not show the use of keywords. I have attached a sample
> of the code I am having trouble with.
>
> The actual error I'm getting is, "Instance does not exist." The error occurs
> when I try entering a keyword. The command doosn't want to except keywords.
> This doesn't kill the command however.
>
> Thanks for your help.
>
> Wayne
0 Likes
Message 10 of 11

Anonymous
Not applicable
Sorry, It would help if I looked thru the code first and saw what you were
trying to get it to do. I agree with you guys, it appears busted in the
mcComponent version.

This doesn't work
Set pick = util.pick("Select component", mcComponent, , , "Word", KWused)
This does work
Set pick = util.pick("Select Profile to loft", mcSketch, , , "Loft", KWused)

--
Kent Keller

Check out the Mechanical Desktop FAQ @
http://mymcad.com/
"Kent Keller" wrote in message
news:04F33D6C72B3D26227277ADA7D8BC67B@in.WebX.SaUCah8kaAW...
> Guys
>
> I may be missing the issue, but I just started a new drawing made a default
> part, loaded the dvb, and run it. At the prompt I typed in Part1_1 and it
> returned successful. Is that what you were trying to get?
>
> --
> Kent Keller
>
> Check out the Mechanical Desktop FAQ @
> http://mymcad.com/
> "W Massey" wrote in message
> news:793BBACB1F3F6C8367C7CCB3DBD82A03@in.WebX.SaUCah8kaAW...
> > Gary,
> >
> > Your example does not show the use of keywords. I have attached a sample
> > of the code I am having trouble with.
> >
> > The actual error I'm getting is, "Instance does not exist." The error occurs
> > when I try entering a keyword. The command doosn't want to except keywords.
> > This doesn't kill the command however.
> >
> > Thanks for your help.
> >
> > Wayne
>
0 Likes
Message 11 of 11

Anonymous
Not applicable
Thanks, that gives me an idea.

"Kent Keller" wrote in message
news:549933CC4D084CC60066196BD82C827C@in.WebX.SaUCah8kaAW...
> Sorry, It would help if I looked thru the code first and saw what you were
> trying to get it to do. I agree with you guys, it appears busted in the
> mcComponent version.
>
> This doesn't work
> Set pick = util.pick("Select component", mcComponent, , , "Word",
KWused)
> This does work
> Set pick = util.pick("Select Profile to loft", mcSketch, , , "Loft",
KWused)
>
> --
> Kent Keller
>
> Check out the Mechanical Desktop FAQ @
> http://mymcad.com/
> "Kent Keller" wrote in message
> news:04F33D6C72B3D26227277ADA7D8BC67B@in.WebX.SaUCah8kaAW...
> > Guys
> >
> > I may be missing the issue, but I just started a new drawing made a
default
> > part, loaded the dvb, and run it. At the prompt I typed in Part1_1 and
it
> > returned successful. Is that what you were trying to get?
> >
> > --
> > Kent Keller
> >
> > Check out the Mechanical Desktop FAQ @
> > http://mymcad.com/
> > "W Massey" wrote in message
> > news:793BBACB1F3F6C8367C7CCB3DBD82A03@in.WebX.SaUCah8kaAW...
> > > Gary,
> > >
> > > Your example does not show the use of keywords. I have attached a
sample
> > > of the code I am having trouble with.
> > >
> > > The actual error I'm getting is, "Instance does not exist." The error
occurs
> > > when I try entering a keyword. The command doosn't want to except
keywords.
> > > This doesn't kill the command however.
> > >
> > > Thanks for your help.
> > >
> > > Wayne
> >
>
0 Likes