Problem of McadTitleBorderMgr andMcadTitle objects of AutoCAD Mechanical 2015

Problem of McadTitleBorderMgr andMcadTitle objects of AutoCAD Mechanical 2015

smilinger
Advisor Advisor
1,570 Views
6 Replies
Message 1 of 7

Problem of McadTitleBorderMgr andMcadTitle objects of AutoCAD Mechanical 2015

smilinger
Advisor
Advisor

Hi, I am creating a Inventor to AutoCAD Mechanical drawing converting program in VBA.

 

The Inventor version I use is Inventor 2015 SP2 Update 5, with AutoCAD Mechanical 2015 SP2.

 

The program can run smoothly with Inventor 2015 SP2 Update 5 and AutoCAD Mechanical 2012 or 2016, but not OK with 2015.

 

Whenever I try to run the program, it shows this message:

 

2017-11-29_19-16-22.png

 

I found if I comment the follow line of code, then the message above is gone:

 

Dim title as McadTitle

 

However the next message I get is this:

 

2017-11-29_19-17-25.png

I cannot just let these lines of code gone, it's part of what the program is coded for, to replace inventor title blocks with ACADM title blocks. I have tried the program in two machines, one in Windows 7 and one in Windows 10, same result. Don't know what's wrong with it. The references used in the VBA project is as follows:

 

2017-11-29_19-16-10.png

 

Please help me with this.

0 Likes
1,571 Views
6 Replies
Replies (6)
Message 2 of 7

Ed__Jobe
Mentor
Mentor

I don't have ACADM installed to tell you which library to reference, but you would need to reference that as well. The acad tlb doesn't have McadTitle.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 7

smilinger
Advisor
Advisor

Like I said the program works perfectly with ACADM 2012 and 2016. The library needed here is SymbbAuto 6.0 (for ACADM 2015), which is already referenced in the picture.

 

I guess it's some type of Type mismatch problem, maybe because I installed multiple version of ACADM in my machine, however I've already tried uninstall ACADM 2016 and reinstalled 2015 on one of the machine, still same result.

0 Likes
Message 4 of 7

Ed__Jobe
Mentor
Mentor

I see its at ver 6.0. Is there a more current version?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 6 of 7

Ed__Jobe
Mentor
Mentor

Sorry, I don't have any other suggestions.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 7 of 7

smilinger
Advisor
Advisor

I guess I might find the problem, it looks something about 64 bit sort of thing.

 

The property BlockId of McadTitle is only for 64 bit, but in ACADM 2015 64 bit it's not accessible.

 

The following simple code will cause "Unknown error (32810)", because the last line of code tring to access the BlockId property.

 

Sub test()
    Dim symbb As McadSymbolBBMgr
    Set symbb = ThisDrawing.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr.6")
    
    Dim titBrdMgr As McadTitleBorderMgr
    Set titBrdMgr = symbb.TitleBorderMgr
    
    Dim titBrdCntx As McadTitleBorderContext
    Set titBrdCntx = titBrdMgr.NewContext
    
    Dim titBrdDesc As McadTitleBorderDescriptor
    Set titBrdDesc = titBrdMgr.NewDescriptor
    
    titBrdDesc.Border.Name = "gb_a3"
    titBrdDesc.Title.Name = "gb_title"
    
    Dim titBrd As McadTitleBorder
    Set titBrd = titBrdMgr.CreateTitleBorder(titBrdDesc, titBrdCntx)
    
    Dim title As McadTitle
    Set title = titBrdDesc.Title
    
    Dim titblk As AcadBlockReference
    Set titblk = ThisDrawing.ObjectIdToObject(title.BlockId)
End Sub

 

@xiaodong_liang, 梁工,抱歉打扰,可以看看这个问题吗?

0 Likes