MCAD Pick error

MCAD Pick error

Anonymous
Not applicable
414 Views
11 Replies
Message 1 of 12

MCAD Pick error

Anonymous
Not applicable
Hi,

 

I use the following code in Mechanical Desktop
5:


size=2>'===============================================

    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 feature", mcFeature)


size=2>'================================================

 

On the the last line I get the following error
msg.

        
    Generic failure to execute operation with provided
arguments.

 

The references are set to the appropriate Mcad
objects and on whatever machine I try this it give me the same
message.

 

Does anybody know what the problem is?

 

Wouter

 

 


0 Likes
415 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable
Wouter

Are you sure you are referencing the right libraries. it should be the 2.0
version of them. Your code below runs without error on my machine.

"Wouter van Eck" wrote in message
news:F5C5EB25CA49CD3AE153E9C88F515238@in.WebX.SaUCah8kaAW...
> Hi,
>
> I use the following code in Mechanical Desktop 5:
> '===============================================
> 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 feature", mcFeature)
> '================================================
>
> On the the last line I get the following error msg.
> Generic failure to execute operation with provided arguments.
>
> The references are set to the appropriate Mcad objects and on whatever
machine I try this it give me the same message.
>
> Does anybody know what the problem is?
>
> Wouter
>
>
>
>
>
0 Likes
Message 3 of 12

Anonymous
Not applicable
Works for me as well.

Gary
0 Likes
Message 4 of 12

Anonymous
Not applicable
I have a reference to:

- Autodesk BrepAuto 2.0 Type Library

- Autodesk GeAuto 2.0 Type Library

- Autodesk McadAuto 2.0 Type Library

- Autodesk SymBBAuto 2.0 Type Library

 

Should be enough I would say :-)... nothing is
missing...and I get the objects alright but no luck in getting it to
work..

 

Any ideas?

 

 

> Wouter
>

> Are you sure you are referencing the right libraries.  it should
be the 2.0
> version of them.   Your code below runs without
error on my machine.
>
> "Wouter van Eck" <

href="mailto:wouter@flyersoft.com">
size=2>wouter@flyersoft.com
> wrote in
message
>

href="news:F5C5EB25CA49CD3AE153E9C88F515238@in.WebX.SaUCah8kaAW">
face=Arial
size=2>news:F5C5EB25C...

face=Arial size=2>...
> > Hi,
> >
> > I use the
following code in Mechanical Desktop 5:
> >
'===============================================
>
>     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 feature",
mcFeature)
> >
'================================================
> >
> > On
the the last line I get the following error msg.
>
>             
Generic failure to execute operation with provided arguments.
>
>
> > The references are set to the appropriate Mcad objects and on
whatever
> machine I try this it give me the same message.
>
>
> > Does anybody know what the problem is?
> >
>
> Wouter
> >
> >
> >
> >
>
>
>
0 Likes
Message 5 of 12

Anonymous
Not applicable
Wouter

Have you tried isolating just the code you showed in a new module with
nothing else loaded and see if it works? Only other thing I can think of is
I am running SP2 for MDT5.

"Wouter van Eck" wrote in message
news:1A62CD219E1C9CA96759BD575913D7CD@in.WebX.SaUCah8kaAW...
> I have a reference to:
0 Likes
Message 6 of 12

Anonymous
Not applicable
I did that too... it's running in a new drawing, with a new empty module....
with SP2 aswell... both machines give the same problem...

"Kent Keller" wrote in message
news:A78B53190E23DA6E4991688464E47CE8@in.WebX.SaUCah8kaAW...
> Wouter
>
> Have you tried isolating just the code you showed in a new module with
> nothing else loaded and see if it works? Only other thing I can think of
is
> I am running SP2 for MDT5.
>
> "Wouter van Eck" wrote in message
> news:1A62CD219E1C9CA96759BD575913D7CD@in.WebX.SaUCah8kaAW...
> > I have a reference to:
>
0 Likes
Message 7 of 12

Anonymous
Not applicable
First of all your code sinppet runs fine on my
machine.

 

You may try the initialization with

Set mapp =
ThisDrawing.Application.GetInterfaceObject("Mcad.Application.2")

 

That should make sure that you get the right
interface for MDT5.

 

Try to run mcadautoreg.exe, which is in the MDT
directory. This should do the registry entries again. Maybe something went
wrong. Do you have admin writes on your machine ?

 

Hope ths helps.

 

Regards,

Christian


style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">

Hi,

 

I use the following code in Mechanical Desktop
5:


size=2>'===============================================

    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 feature", mcFeature)


size=2>'================================================

 

On the the last line I get the following error
msg.

        
    Generic failure to execute operation with provided
arguments.

 

The references are set to the appropriate Mcad
objects and on whatever machine I try this it give me the same
message.

 

Does anybody know what the problem
is?

 

Wouter

 

 


0 Likes
Message 8 of 12

Anonymous
Not applicable
Christian

Thanks for the tips. I've been having some sort of conflict between newer
and older programs using the two different models. I'll bet your suggestions
are the answer to the problem.

Gary
0 Likes
Message 9 of 12

Anonymous
Not applicable
I just found out that when I start 'Autocad Mechanical 2000i Power Pack'
then it doesn't work and a lot of other functions don't either.

It works fine with AutoCAD Mechanical Desktop...

Wouter

"Gary McMaster" wrote in message
news:81A2B180FF34465890D102EF030FF737@in.WebX.SaUCah8kaAW...
> Christian
>
> Thanks for the tips. I've been having some sort of conflict between newer
> and older programs using the two different models. I'll bet your
suggestions
> are the answer to the problem.
>
> Gary
>
0 Likes
Message 10 of 12

Anonymous
Not applicable
That's another good point. I didn't have power pack with MDT4 and have never
tried MDT5 without it.

None of my VBA stuff will run in MDT4 anymore since installing MDT5, but it
still runs fine in MDT5.

Gary
0 Likes
Message 11 of 12

Anonymous
Not applicable
That's because AutoCAD Mechanical and Mechanical Desktop are two
entirely separate products.

--
http://www.acadx.com

All use of the contents of this article is subject to the
terms and conditions at http://www.acadx.com/csc.htm

"Wouter van Eck" wrote in message
news:64B26D437356584DD429D3898D321C3D@in.WebX.SaUCah8kaAW...
> I just found out that when I start 'Autocad Mechanical 2000i Power
Pack'
> then it doesn't work and a lot of other functions don't either.
>
> It works fine with AutoCAD Mechanical Desktop...
>
> Wouter
0 Likes
Message 12 of 12

Anonymous
Not applicable
The MDT4 code is untouched and still referencing the McadAuto 1.0 and the
other 1.0 models. It runs on any MDT4 machine until MDT5 is installed. It
continues running in MDT5 even though still referencing the MDT4 model. Just
seems a little strange.

Gary
0 Likes