CAD Attribute Reader example

In Visual Components 4.4, we’ve introduced a new feature, called CAD Attribute Reader, that reads your 2D CAD data and converts them into 3D layouts.

Attached you can find CAD Attribute Reader.zip file CAD Attribute Reader.zip (973.1 KB). The file has an example 2D drawing, addon’s, code sample and instructions to use the addon.

4 Likes

I faced similar kind of issue last time, I am still searching for some proper solution

Is it obsolete in version 4.2?

The CAD attribute reader requires VC version 4.4, or later, to operate.

1 Like

Heyaa!

Is it possible that the DWG Attribute Reader is not working anymore in 4.5?
I get the following message when I press on the attribute reader button:
System.IO.FileNotFoundException: Could not load file or assembly ‘System.Text.Encodings.Web, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ or one of its dependencies. The system cannot find the file specified.

I copied both dlls (Plugin.ReadDWGBlock.dll and System.Text.Json.dll).

Any ideas what I’m doing wrong?

Best
Johnny

@ProLean zip file updated. The file was missing the required dll. Add System.Text.Encodings.Web.dll to the installation folder and test again

1 Like

Hi @Popeye, thanks for adding the dll.
Unfortunately I still get the error message.
I noticed the dll you attached to the ZIP is from .NET 6.0.
The error message however is complaining about the missing dll with Version 5.0.0.1.
I tried to install .NET 5.0 however it didn’t help either.
How did you get it to work on your side?

I just tried with a clean install, copied the 3 DLL files to the installation folder. It worked with the example dwg file.

I just tried to install, and nothing is working. I have a few questions:

  • What is the typical address of the installation folder? I have been trying C:\Users<Username>\Documents\Visual Components<Version Number>\My Commands?
  • Does this add-on work with 4.6 professional and premium versions?
  • Should I be moving all .DLL files and .CS file or just the .DLL files?\

Any ideas?
Thanks!
Update: Turns out I was moving the files to the wrong folder. The folder that I needed to use was:
C:\Program Files\Visual Components\Visual Components <professional/premium version number>

Now I’m having a problem with System.Text.Encodings.Web.DLL

The My Commands folder is only for python addons.
.NET addons (.dll) should be placed in the VC installation folder in Program Files.

  1. Download and unzip the files
  2. Copy the DLL files to the installation folder, for example: C:\Program Files\Visual Components\Visual Components Premium 4.6
  3. Start VC application
1 Like

@Este Hello
I follow the steps

  1. Download and unzip the files
    2.Copy the DLL files to the installation folder, for example: C:\Program Files\Visual Components\Visual Components Premium 4.6
    3.Start VC application
    But after importing the layout, then Click the DWG Attributes Reader command
    An error message popped up

Got it working by copying a version 5.0 System.Text.Encodings.Web.dll with the same public key as mentioned in the error message (cc7b13ffcd2ddd51) into Visual Components root.
So it seems like the version is the issue.

@Este I guess even though you tested with a fresh VC installation, it might be that the required version 5.0 dll was somewhere available on your PC where Visual Components has access to. Is that possible?

Unhandled exception occurred:System.IO.FileLoadException: Could not load file or assembly ‘System.Text.Encodings.Web, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: ‘System.Text.Encodings.Web, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’
at System.Text.Json.JsonPropertyInfo.DeterminePropertyName()
at System.Text.Json.JsonPropertyInfo.GetPolicies(Nullable1 ignoreCondition, Nullable1 parentTypeNumberHandling, Boolean defaultValueIsNull)
at System.Text.Json.JsonClassInfo.CreateProperty(Type declaredPropertyType, Type runtimePropertyType, MemberInfo memberInfo, Type parentClassType, JsonConverter converter, JsonSerializerOptions options, Nullable1 parentTypeNumberHandling, Nullable1 ignoreCondition)
at System.Text.Json.JsonClassInfo.CreatePropertyInfoForClassInfo(Type declaredPropertyType, Type runtimePropertyType, JsonConverter converter, JsonSerializerOptions options)
at System.Text.Json.JsonClassInfo…ctor(Type type, JsonSerializerOptions options)
at System.Text.Json.JsonSerializerOptions.GetOrAddClass(Type type)
at System.Text.Json.JsonSerializerOptions.GetOrAddClassForRootType(Type type)
at System.Text.Json.ReadStack.Initialize(Type type, JsonSerializerOptions options, Boolean supportContinuation)
at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, Type returnType, JsonSerializerOptions options)
at Plugin.ReadDWGBlock.DWGBlockAttributeReader.Execute()
at VisualComponents.UX.Shell.AppBootstrapper.OnInvokeAction(ActionExecutionContext context)
at Caliburn.Micro.ActionMessage.Invoke(Object eventArgs)
at System.Windows.Interactivity.TriggerBase.InvokeActions(Object parameter)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at Infragistics.Windows.Ribbon.ButtonTool.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Ireceived this message how did you resolve it

kindly help me with the above