Load XREF from SQL

1 2 3    next >
Lagen
3/12/2020 8:30 AM

Hi Wout

Is it possible to load a XREF directly from SQL?

I use this for load the model.

Visual Basic Code:
Dim memoryStream As MemoryStream = New MemoryStream()
memoryStream = New MemoryStream(CType(dr.GetValue(0), Byte()))
Dim reader As DwgReader = New DwgReader(memoryStream)
reader.LoadUnknownObjects = True
Dim openModel As DxfModel = reader.Read

Wout
3/12/2020 9:58 AM

Hi Patrik,

Yes you can call this method and specify your own customResolveExternalReference implementation:

C# Code:
DxfModel.LoadExternalReferences(
            DxfBlock.GetExternalReferenceDelegate customResolveExternalReference, 
            out IList<DxfBlock> missingReferences
        )

- Wout

Lagen
3/12/2020 10:00 AM

Great

is the someway for me to know the DWG filename of the XREF that are in my model?

Wout
3/12/2020 10:18 AM

Yes ofcourse, otherwise this method would be pointless. Have a look at the definition of the delegate.

- Wout

Lagen
3/12/2020 3:54 PM

Hi wout

Is it in this "CadLib4_0.mshc" I should search for help?

/Patrik

Wout
3/12/2020 4:14 PM

You can look in the Visual Studio object browser and find it or look at the online documentation.

- Wout

Lagen
3/15/2020 11:05 AM

Hi Wout

I have problem to success with this.
boot get the included XREF and add to the model.

You have some sample code?

Wout
3/15/2020 4:48 PM

I don't have sample code, you just need to implement a method that matches the delegate signature. It's just basic .NET, you can look for delegate examples on the internet.

- Wout

Lagen
3/15/2020 5:20 PM

Thanks for your replay Wout.

I already try to do what you tell me to do.

/Patrik

Lagen
3/18/2020 1:30 PM

Hi Wout

I can not success to get a list of XREF and then load the XREF from the SQL server.
Is it possible for me to buy that code from you?

/Patrik

1 2 3    next >