-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The following compile error is displayed when ModelDocExtension class is used explicitly:
error CS0433: The type 'ModelDocExtension' exists in both 'CodeStack.SwEx.AddIn, Version=0.8.1.0, Culture=neutral, PublicKeyToken=a46023996d4724e7' and 'SolidWorks.Interop.sldworks, Version=27.1.0.72, Culture=neutral, PublicKeyToken=7c4797c3e4eeac03'
ModelDocExtension modelDocExt2 = model.Extension;
var appPageSetup4 = modelDocExt2.AppPageSetup;This only happens if variable of type ModelDocExtension is declared explicitly.
The are several workarounds available:
- Use IModelDocExtension instead of ModelDocExtension
IModelDocExtension modelDocExt1 = model.Extension;
var appPageSetup3 = modelDocExt1.AppPageSetup;- Use var in C# to avoid explicit declaration
var modelDocExt = model.Extension;
var appPageSetup2 = modelDocExt.AppPageSetup;- Do not declare the variable, but use Extension property of IModelDoc2
var appPageSetup1 = model.Extension.AppPageSetup;Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working