Extrating data from .dwg file

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
chandu2chandu1
Posts: 5
Joined: 01 Oct 2009, 14:15

Extrating data from .dwg file

Post by chandu2chandu1 » 01 Oct 2009, 14:31

Hi,

Is there any way to extract the text from .dwg file. I am new to this area, please let me know how to achieve this functionality.

Thanks,
Chandra Sekhar S.

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Extrating data from .dwg file

Post by support » 01 Oct 2009, 15:49

Hello.
You can receive CADText or CADMText object using CADImage.Converter.Entities.Item() property after loading DWG file.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

chandu2chandu1
Posts: 5
Joined: 01 Oct 2009, 14:15

Re: Extrating data from .dwg file

Post by chandu2chandu1 » 01 Oct 2009, 16:13

Hi Alexander,

Thanks for the reply. Currently I am using the trail version to test the application. Can you suggest me in more detail, please. Because the CADText and the CADMText classes are not found in the dll file I use. I can only load the image using CADImage class. I am not sure about the namespaces for that. If possible please tell me where can I find the documentation for this.

Thanks

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Extrating data from .dwg file

Post by support » 01 Oct 2009, 17:00

You need CAD Import .NET extended version to access entities. Please mail to support@cadsofttools.com.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

chandu2chandu1
Posts: 5
Joined: 01 Oct 2009, 14:15

Re: Extrating data from .dwg file

Post by chandu2chandu1 » 02 Oct 2009, 16:00

Hi Alexander,

I had the CAD Import .NET Extension version now. I tried for the solution as you told early to use in this way
You can receive CADText or CADMText object using CADImage.Converter.Entities.Item() property after loading DWG file.
Unfortunately I cannot figure out the Item method in the CADImage.Converter.Entites. After loading the CADImage if I try to use the property called AllStringValues it is throwing the following exception,

System.ArrayTypeMismatchException was unhandled by user code
Message="Attempted to access an element as a type incompatible with the array."
Source="System"
StackTrace:
at System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllValues(Type type)
at CADImport.CADEntityCollection.get_AllStringValues()
at _Default.Page_Load(Object sender, EventArgs e) in d:\DWGExtractor\Default.aspx.cs:line 35
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:

Any help regarding this would be appreciated.

Thanks

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Extrating data from .dwg file

Post by support » 02 Oct 2009, 16:41

Hello.
Please look at the syntax description of the CADImage.Converter.Entities.Item property in CAD Import .NET help system.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

chandu2chandu1
Posts: 5
Joined: 01 Oct 2009, 14:15

Re: Extrating data from .dwg file

Post by chandu2chandu1 » 03 Oct 2009, 10:18

This is not related to syntax. The member Item is not available in the CADImage.Converter.Entities class, I say.

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Extrating data from .dwg file

Post by support » 05 Oct 2009, 12:05

Code: Select all

CADEntityCollection.Item Property (UInt64)
 
Syntax

Visual Basic (Declaration) 
Public Default ReadOnly Property Item( _ ByVal handle As UInt64 _ ) As CADEntity
 
C# 
public CADEntity this[ ulong handle ] { get; } 

C++ 
public property CADEntity default[unsigned __int64 handle] sealed  {CADEntity get(unsigned __int64 handle);} 

J# 
/** property */
public CADEntity get_Item(ulong handle);
As you can see this is related to syntax.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

chandu2chandu1
Posts: 5
Joined: 01 Oct 2009, 14:15

Re: Extrating data from .dwg file

Post by chandu2chandu1 » 05 Oct 2009, 13:00

I can see that in documentation dude. But, I cannot figure that either in intellisense and it show compiler error if I used the Item method forcefully. The CADImport.dll version I use is 7.2.2.19035. Please verify this ASAP.

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Extrating data from .dwg file

Post by support » 05 Oct 2009, 13:32

There is a difference between using Item property in different programming languages. For example, if you using VB.NET call this property in such way:

Code: Select all

CADImage.Converter.Entities.Item(...)
And if you using C# calling will be looks like:

Code: Select all

CADImage.Converter.Entities[...]
C++ and J# also have own variants of this property using.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply