WPF tree view dialog is blank

WPF tree view dialog is blank

Allen_Hart
Advocate Advocate
965 Views
4 Replies
Message 1 of 5

WPF tree view dialog is blank

Allen_Hart
Advocate
Advocate

I have a small sheet set app that loads the list of sheets & views into a wpf tree view list. (We use it to associate callout blocks to a sheet set view.)  It's been working very well.  I decided to recompile the code with references to the current ACAD files (AcCoreMgd, AcDbMgd, AcMgd, & ACSMCOMPONENTS22Lib) & .NETFramework 4.6.  Now the tree view is blank.  Stepping through the code in debug clearly shows the data is there ready to display but it just doesn't. 

 

Is anyone else seeing odd behavior with current rebuilds? 

 

thanks,

Allen

 

 

0 Likes
Accepted solutions (1)
966 Views
4 Replies
Replies (4)
Message 2 of 5

moogalm
Autodesk Support
Autodesk Support

I suspect the problem either could be with registering acsmcomponents22.tlb or may require debugging to understand the problem.

 

 

 

The type lib is acsmcomponents22.tlb, this needs to register using "tlbimp".

 

 

 

Component Name                                                        UUID                                                                                Release

AcSmComponents.AcSmSheetSetMgr.22              8026E779-B5FB-4EE2-8D94-DCBD406394C5        AutoCAD 2018

AcSmComponents.AcSmSheetSetMgr.20              B1C4EDD8-0266-46C9-A9BB-1F9655D5E402        AutoCAD 2016

 

 

To troubleshoot the problem now, use should register latest component assembly which is shipped with AutoCAD 2018 ObjectARX SDK/

 

  • First register the tlb.
  • tlbimp <.tlb> /machine: "X64"
    • Note: Type libraries supplied with SDK needs to be register, UUIDs of components should be written to registry hive.
    • Ideally, AutoCAD at time of installing should have done, but it is not doing for SDK interop’s, may be for legacy reasons.
  • Next, add the generated assembly to .csproj
  • Build and run // it should work.

 

 

 

  • You can retrieve class id, by using " oleview <.tlb>" from Visual Studio Developer command.
  • From the oleview editor, get the “UUID of required component”
  • oleTlb.jpg
  • Search the class id in registry hive.
  • If it is not present, go and register the typelib.
0 Likes
Message 3 of 5

Allen_Hart
Advocate
Advocate

madhukar.moogala,  Thanks for your response.

 

I'm not familiar with "oleview editor" - using VS Community 2017 and VB.Net. I know barely enough to write a small app.

Anyway, I did find the UUID you show for 2018 in the registry.

 

I have two copies of the AcSmComponents22.tlb file.
- one in \Program Files\Common Files\Autodesk Shared.  File version says 22.0.154.0.0
- one in \Autodesk\Autodesk_ObjectARX_2018_Win_64_and_32_Bit\inc-x64.  File version says 22.0.49.0.0

 

I've built the app using both, with the same results.  It builds with no errors or warnings, loads and runs fine in AutoCAD.  Just won't display the sheet set data.  Here are before & after screen snags:

 

ssm1.PNG

ssm2.PNG

Maybe the problem is not with the .tlb reference, but instead with the three .dll references?

 

Still confused,

Allen

 

0 Likes
Message 4 of 5

norman.yuan
Mentor
Mentor
Accepted solution

If your debugging clearly shows the "data is there", that means the data related to the sheet set is correctly obtained, so, there is no point to suspect anything wrong with the AutoCAD .NET API assemblies and the AcsmComponents22.tlb (by the way, the mentioning of "registering AcsmComponents22.tbl" in the other post is sort of misleading: Tlbimport is for generating .NET interop wrapper for a COM component, which has nothing to do with registering COM DLL/TLB with Windows registry).

 

So, you need to make really sure if the data is actually there prior to present them in the form/dialog box. If the data is there, then you only need to examine the code of presenting data. For example, if you use MVVM pattern to bind data to the form, how the DataContext is set/bounf to the view, do you have typing error of the binding properties in the view...

 

You only suspect something could be related to the AcsmComponents22 when there is no sheet set data is obtained, or you get exceptions when retrieve sheet set data (do you have empty catch{} clause in your code that could hide the exception?).

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 5

Allen_Hart
Advocate
Advocate

Thanks norman.yuan, you are correct to suggest spell checking.  I double checked my xaml code and sure as s*** the case of the variable names did not match those in the classes. Don't remember when it happened but I know how it happened.  I must've took VS's suggestion to correct it. It surely likes to popup it's little light bulbs with suggestions for "improvement".  Of course I trusted it too much and did not think to check the xaml code.

 

Problem solved.

thanks

Allen

 

0 Likes