.NET

Reply
Contributor
ranjith0326
Posts: 24
Registered: ‎04-16-2011
Message 1 of 17 (1,452 Views)
Accepted Solution

Unloading DLL

1452 Views, 16 Replies
01-02-2012 09:56 PM

Greetings..

 

Here i want to ask my doubt..

How to Unload the DLL from Autocad...

 

the reason is after loading the dll files..

Autocad was creating fatal error..

 

Give me some suggesion to avoid this error..

 

Thanks in Advance

Regards,

R.Ranjith

By looking at your code I can give you this advice :

0. Start documenting your code with reasonable comments.

0a. Read this also - http://catb.org/~esr/faqs/smart-questions.html - I have read it myself and saved myself a fortune of others time and mine ofcourse.

1. Read the developers tutorial - I have posted a link before. There are lots of things you must read in order to continue using the managed api without having lots of problems and without asking such questions.

2. Get the ObjectARX Docs and open arxmgd.chm file and read the docs for every method you are using.

 

Sincerely, I do not know why are using the CloseInput() method. I suppose your intent was different and I dont know what it is. Please go through the tutorials provided by Autodesk.

 

Please start from 0 and 0a before anything else. This will save you lots of silly mistakes and will improve your productivity many times.

Valued Mentor
jeff
Posts: 330
Registered: ‎05-12-2009
Message 2 of 17 (1,448 Views)

Re: Unloading DLL

01-02-2012 10:15 PM in reply to: ranjith0326

To unload the dll just shutdown AutoCAD or turn off your computer.

 

 

Without more information about error try not starting AutoCAD or leave your computer turned off.

 

You can also find your answers @ TheSwamp
Valued Contributor
ognyandim
Posts: 59
Registered: ‎05-21-2008
Message 3 of 17 (1,437 Views)

Re: Unloading DLL

01-02-2012 11:32 PM in reply to: jeff

Jeff, there is no need to be rude and produce spam on this forum.

 

In general I still dont know a way for unloading a .NET dll from AutoCAD. Probably you have used IExtensionApplication interface and doing something wrong in there and when you load the DLL and AutoCAD excutes the Initialize method the crash happens. This happens also if you have static class that initializes connection to external database that is currently unavailible or the like.

 

If you provide your code here we will help. Without code there can be only guesses as the two with wich a tried to guess your problem ( above ).

 

Try searching the forum before asking, because this question was answered more than once. Try searching www.theswamp.org too.

 

 

Contributor
ranjith0326
Posts: 24
Registered: ‎04-16-2011
Message 4 of 17 (1,430 Views)

Re: Unloading DLL

01-02-2012 11:48 PM in reply to: ognyandim

Dear ognyandim...

 

Find below my code..

Thanks for your Decent Response..

 

Regards,

 

Ranjith

 

 

Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.GraphicsInterface
Imports System.IO
Imports Autodesk.AutoCAD
Imports Autodesk.AutoCAD.LayerManager
Imports System.Windows.Forms
Public Class frmmain
Public FNames() As String
Dim myTranst As DatabaseServices.Transaction
Public myTransMan As DatabaseServices.TransactionManager, ErrorFiles As Short = 0
Public myTrans As DatabaseServices.Transaction
Public myBTR As DatabaseServices.BlockTableRecord
Public myBlkRef As DatabaseServices.BlockReference
Public myBT As DatabaseServices.BlockTable
Public myDWG As ApplicationServices.Document, DrgFName As String = ""
Dim db_table_ary(-1, -1) As String

Dim part_qty As String
Dim part_mark As String
Dim test_table As New Data.DataTable
Private Sub bt_close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_close.Click
purpose = ""
ReDim final_part_array(-1, -1)
Me.Dispose()
End Sub
Private Sub bt_Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_Add.Click
If FileBrowser.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Exit Sub
For Each FName As String In FileBrowser.FileNames
Try
DrgFName = My.Computer.FileSystem.GetName(FName)
If ListBox1.Items.Count < 1 Then
ListBox1.Items.Add(0)
ListBox1.Items.Item(0) = DrgFName
Else
ListBox1.Items.Add(ListBox1.Items.Count)
ListBox1.Items.Item(ListBox1.Items.Count - 1) = DrgFName
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Next
no_of_files.Text = ListBox1.Items.Count.ToString & " files Added"
End Sub
Private Sub bt_remove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_remove.Click
Dim piIndex As Integer
For piIndex = ListBox1.SelectedItems.Count - 1 To 0 Step -1
ListBox1.Items.Remove(ListBox1.SelectedItems(piIndex))
Next
End Sub
Private Sub bt_cut_list_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_cut_list.Click
If ListBox1.Items.Count = 0 Then
MsgBox("The list is empty.", vbExclamation, "Empty List")
Exit Sub
Else
ReDim file_list(ListBox1.Items.Count - 1)
For i As Integer = 0 To ListBox1.Items.Count - 1
file_list(i) = ListBox1.Items(i)
Next
End If
create_cut_list()
'Me.Dispose()
End Sub
Private Sub create_cut_list()
For a As Integer = 0 To file_list.GetUpperBound(0)
If FileIO.FileSystem.FileExists(file_list(a)) Then
read_table(file_list(a))
Else
MsgBox(file_list(a) & " Not available", MsgBoxStyle.OkOnly)
End If
Next
make_table()
'Show_Data(db_table_ary, , , , True)
'Me.Dispose()
End Sub
Public Sub make_table()
Dim drw As DataRow
test_table.Columns.Add("Thick", System.Type.GetType("System.Int16"))
test_table.Columns.Add("Piece_Mark", System.Type.GetType("System.String"))
test_table.Columns.Add("Total_Qty", System.Type.GetType("System.String"))
test_table.Columns.Add("Width1", System.Type.GetType("System.String"))
test_table.Columns.Add("Width2", System.Type.GetType("System.String"))
test_table.Columns.Add("Length", System.Type.GetType("System.String"))
test_table.Columns.Add("Main", System.Type.GetType("System.String"))
test_table.Columns.Add("Ext", System.Type.GetType("System.String"))
test_table.Columns.Add("Unit_Weight", System.Type.GetType("System.String"))
test_table.Columns.Add("Total_Weight", System.Type.GetType("System.String"))
test_table.Columns.Add("Type", System.Type.GetType("System.String"))
test_table.Columns.Add("Shop_Information", System.Type.GetType("System.String"))
test_table.Columns.Add("Part_Mark", System.Type.GetType("System.String"))
test_table.Columns.Add("Part_Qty", System.Type.GetType("System.String"))
test_table.Columns.Add("Piece_Qty", System.Type.GetType("System.String"))
test_table.Columns.Add("Piece_Per_Assembly", System.Type.GetType("System.String"))

For i As Integer = 0 To db_table_ary.GetUpperBound(1)
drw = test_table.NewRow()
If db_table_ary(0, i).StartsWith("S-") Then
drw("Thick") = 200
Else
drw("Thick") = Val(db_table_ary(4, i))
End If

drw("Piece_Mark") = db_table_ary(0, i)
drw("Total_Qty") = ""
drw("Width1") = db_table_ary(5, i)
drw("Width2") = db_table_ary(6, i)
drw("Length") = db_table_ary(7, i)
Dim length As Integer = Val(db_table_ary(7, i))
Dim main_length As Integer
Dim ext_length As Integer
If length > 6000 And length < 6300 Then
main_length = length - 300
ext_length = 300
ElseIf length > 6300 Then
main_length = 6000
ext_length = length - main_length
Else
main_length = 0
ext_length = 0
End If
If main_length <> 0 Then
drw("Main") = main_length.ToString
Else
drw("Main") = ""
End If
If ext_length <> 0 Then
drw("Ext") = ext_length.ToString
Else
drw("Ext") = ""
End If
Dim unit_weight As Double = Math.Round((Val(db_table_ary(8, i)) / Val(db_table_ary(1, i))), 2)
drw("Unit_Weight") = unit_weight
drw("Total_Weight") = Val(db_table_ary(8, i)) * Val(db_table_ary(2, i))
drw("Type") = find_type(db_table_ary(0, i))
drw("Shop_Information") = db_table_ary(9, i)
drw("Part_Mark") = db_table_ary(3, i)
drw("Part_Qty") = db_table_ary(2, i)
drw("Piece_Qty") = db_table_ary(1, i)
drw("Piece_Per_Assembly") = Val(db_table_ary(2, i)) * Val(db_table_ary(1, i))
test_table.Rows.Add(drw)
Next
sum_piece_qty()
test_table.DefaultView.Sort = "Thick,Piece_Mark"
'DataGridView1.DataSource = test_table
'Me.Show()
'Show_Data(, , test_table, , True)
If purpose = "cut_list" Then
Dim DispReport As New ReportForm
DispReport.Rep_Name = "Error Report"
Dim RepForm As New Cut_List_Report
RepForm.SetDataSource(test_table.DefaultView)
RepForm.SetParameterValue("area1", area)
RepForm.SetParameterValue("job1", job_no)
RepForm.SetParameterValue("bldg1", bldg_no)
RepForm.SetParameterValue("phase1", phase_no)
DispReport.CrystalCtrl.ReportSource = RepForm
DispReport.ShowDialog()
Else
part_sk_func()
End If
End Sub
Private Function find_type(ByVal piece As String)
Dim type As String
If piece.Contains("WB") Then
type = "WEB"
ElseIf piece.Contains("OF") Or piece.Contains("IF") Then
type = "FLG"
ElseIf piece.Contains("HR") Or piece.Contains("T-") Then
type = "HR"
Else
type = "DET"
End If
Return Type
End Function
Private Sub part_sk_func()
ReDim final_part_array(7, -1)
test_table.DefaultView.Sort = "Piece_Mark"
For rw As Integer = 0 To test_table.DefaultView.Count - 1
ReDim Preserve final_part_array(7, final_part_array.GetUpperBound(1) + 1)
Dim cur_piece As String = test_table.DefaultView(rw).Item("Piece_Mark")
Dim test_array() As DataRow = test_table.Select("Piece_Mark = '" & cur_piece & "'")
For i As Integer = 0 To (test_array.Length - 1)
Dim part_thick As String = test_array(0).Item("Thick")
'Show_Data(, , test_table, , True)
Dim part_width1 As String = test_array(0).Item("Width1")
Dim part_width2 As String = test_array(0).Item("Width2")
Dim part_length As String = test_array(0).Item("Length")
Dim part_desc As String = ""
If part_width1 <> "" And part_width2 <> "" Then
If part_width1 = part_width2 Then
part_desc = part_thick & "X" & part_width1 & "X" & part_length
Else
part_desc = part_thick & "X" & part_width1 & "-" & part_width2 & "X" & part_length
End If
Else
part_desc = test_array(0).Item("Shop_Information")
End If
final_part_array(0, final_part_array.GetUpperBound(1)) = test_array(i).Item("Piece_Mark")
final_part_array(1, final_part_array.GetUpperBound(1)) = test_array(i).Item("Total_Qty")
final_part_array(2, final_part_array.GetUpperBound(1)) = part_desc
final_part_array(3, final_part_array.GetUpperBound(1)) = test_array(i).Item("Unit_Weight")
final_part_array(4, final_part_array.GetUpperBound(1)) = test_array(i).Item("Shop_Information")
If final_part_array(5, final_part_array.GetUpperBound(1)) <> "" Then
final_part_array(5, final_part_array.GetUpperBound(1)) = final_part_array(5, final_part_array.GetUpperBound(1)) & "," & test_array(i).Item("Part_Mark")
Else
final_part_array(5, final_part_array.GetUpperBound(1)) = test_array(i).Item("Part_Mark")
End If
If final_part_array(6, final_part_array.GetUpperBound(1)) <> "" Then
final_part_array(6, final_part_array.GetUpperBound(1)) = final_part_array(6, final_part_array.GetUpperBound(1)) & "," & test_array(i).Item("Part_Qty")
Else
final_part_array(6, final_part_array.GetUpperBound(1)) = test_array(i).Item("Part_Qty")
End If
If final_part_array(7, final_part_array.GetUpperBound(1)) <> "" Then
final_part_array(7, final_part_array.GetUpperBound(1)) = final_part_array(7, final_part_array.GetUpperBound(1)) & "," & test_array(i).Item("Piece_Qty")
Else
final_part_array(7, final_part_array.GetUpperBound(1)) = test_array(i).Item("Piece_Qty")
End If
Next i
rw = rw + (test_array.Length - 1)
Next
'Show_Data(final_part_array, , , , True)
If purpose = "unique&piece" Then
'If final_part_array.GetUpperBound(1) > -1 Then
' Dim datasource_repeat(final_part_array.GetUpperBound(1)) As dataSource
' For i As Integer = 0 To final_part_array.GetUpperBound(1)
' datasource_repeat(i).Piece = final_part_array(0, i)
' datasource_repeat(i).qty = final_part_array(1, i)
' datasource_repeat(i).Description = final_part_array(2, i)
' datasource_repeat(i).shop_information = final_part_array(4, i)
' Next
' Dim dispreport As New ReportForm
' dispreport.Rep_Name = "Piece Repeated Error"
' Dim RepForm As New Piece_Report
' RepForm.SetDataSource(datasource_repeat)
' dispreport.CrystalCtrl.ReportSource = RepForm
' dispreport.ShowDialog()
'End If
Dim fname As String = My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\" & job_no & "_" & bldg_no & "_" & phase_no & ".txt"
Dim write_ary(final_part_array.GetUpperBound(1)) As String
For i As Integer = 0 To final_part_array.GetUpperBound(1)
write_ary(i) = final_part_array(0, i) & " " & final_part_array(1, i) & " " & final_part_array(2, i) & " " & final_part_array(4, i)
Next
write_file(write_ary, fname)
End If
Me.Dispose()

'For rw As Integer = 0 To test_table.Rows.Count - 1
' Dim cur_piece As String = test_table.Rows(rw).Item("Piece_Mark")
' Dim qty As Integer = 0
' 'test_table = test_table.DefaultView.Table
' Dim drarray() As DataRow = test_table.Select("Piece_Mark = '" & cur_piece & "'")
' For i As Integer = 0 To (drarray.Length - 1)
' 'ListBox1.Items.Add(drarray(i)("City").ToString)
' qty = qty + Val(drarray(i).Item("Piece_Per_Assembly"))
' Next
' test_table.Rows(rw).Item("Total_Qty") = qty.ToString
' test_table.Rows(rw).Item("Total_Weight") = (qty * Val(test_table.Rows(rw).Item("Unit_Weight"))).ToString
'Next


End Sub
Private Sub sum_piece_qty()
For rw As Integer = 0 To test_table.Rows.Count - 1
Dim cur_piece As String = test_table.Rows(rw).Item("Piece_Mark")
Dim qty As Integer = 0
'test_table = test_table.DefaultView.Table
Dim drarray() As DataRow = test_table.Select("Piece_Mark = '" & cur_piece & "'")
For i As Integer = 0 To (drarray.Length - 1)
'ListBox1.Items.Add(drarray(i)("City").ToString)
qty = qty + Val(drarray(i).Item("Piece_Per_Assembly"))
Next
test_table.Rows(rw).Item("Total_Qty") = qty.ToString
test_table.Rows(rw).Item("Total_Weight") = (qty * Val(test_table.Rows(rw).Item("Unit_Weight"))).ToString
Next
End Sub
Public Sub read_table(ByVal fname As String)
part_qty = ""
part_mark = ""
Dim myTransMant As DatabaseServices.TransactionManager
Dim CurDb As New DatabaseServices.Database
Dim myBTRt As DatabaseServices.BlockTableRecord
Dim myBTt As DatabaseServices.BlockTable
Dim myDBt As New DatabaseServices.Database(False, True)
If fname.ToUpper.EndsWith("DWG") Then
myDBt.ReadDwgFile(fname, IO.FileShare.Read, False, "")
End If
myTransMant = myDBt.TransactionManager
myTranst = myTransMant.StartTransaction
myBTt = myDBt.BlockTableId.GetObject(DatabaseServices.OpenMode.ForRead)
myBTRt = myBTt(DatabaseServices.BlockTableRecord.ModelSpace).GetObject(DatabaseServices.OpenMode.ForWrite)
Dim myBTEn As DatabaseServices.BlockTableRecordEnumerator = myBTRt.GetEnumerator()
While myBTEn.MoveNext
Dim oEnt As DatabaseServices.Entity = CType(myTranst.GetObject(myBTEn.Current, DatabaseServices.OpenMode.ForRead), DatabaseServices.Entity)
If TypeOf oEnt Is DatabaseServices.Table Then
Dim MyTbl As New DatabaseServices.Table
MyTbl = myBTEn.Current.GetObject(DatabaseServices.OpenMode.ForRead)

For Rw As Short = 0 To MyTbl.NumRows - 1
Dim cur_piece As String = MyTbl.TextString(Rw, 0, FormatOption.ForExpression)
If Not cur_piece.Contains("WEIGHT") And Not cur_piece.Contains("MARK") And cur_piece <> "" Then
ReDim Preserve db_table_ary(9, db_table_ary.GetUpperBound(1) + 1)
db_table_ary(0, db_table_ary.GetUpperBound(1)) = MyTbl.TextString(Rw, 0, FormatOption.ForExpression)
db_table_ary(1, db_table_ary.GetUpperBound(1)) = MyTbl.TextString(Rw, 1, FormatOption.ForExpression)
db_table_ary(2, db_table_ary.GetUpperBound(1)) = part_qty
db_table_ary(3, db_table_ary.GetUpperBound(1)) = part_mark
db_table_ary(8, db_table_ary.GetUpperBound(1)) = MyTbl.TextString(Rw, 3, FormatOption.ForExpression)
db_table_ary(9, db_table_ary.GetUpperBound(1)) = MyTbl.TextString(Rw, 4, FormatOption.ForExpression)
Dim cur_desc As String = MyTbl.TextString(Rw, 2, FormatOption.ForExpression)
Dim desc_ary() As String = cur_desc.Split("X")
db_table_ary(4, db_table_ary.GetUpperBound(1)) = desc_ary(0)
Select Case Val(desc_ary(0))
Case 1.5, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 14, 18, 25, 30, 40, 50
If desc_ary(1).Contains("-") Then
db_table_ary(5, db_table_ary.GetUpperBound(1)) = desc_ary(1).Split("-")(0)
db_table_ary(6, db_table_ary.GetUpperBound(1)) = desc_ary(1).Split("-")(1)
Else
db_table_ary(5, db_table_ary.GetUpperBound(1)) = desc_ary(1)
db_table_ary(6, db_table_ary.GetUpperBound(1)) = desc_ary(1)
End If
db_table_ary(7, db_table_ary.GetUpperBound(1)) = desc_ary(2)
Case Else
db_table_ary(4, db_table_ary.GetUpperBound(1)) = 100 'others
db_table_ary(5, db_table_ary.GetUpperBound(1)) = ""
db_table_ary(9, db_table_ary.GetUpperBound(1)) = cur_desc
db_table_ary(6, db_table_ary.GetUpperBound(1)) = ""
db_table_ary(7, db_table_ary.GetUpperBound(1)) = desc_ary(desc_ary.GetUpperBound(0))
End Select
End If
Next
MyTbl.Dispose()
End If
If oEnt.GetType.Name.ToUpper = "BLOCKREFERENCE" Then
myBlkRef = oEnt.ObjectId.GetObject(DatabaseServices.OpenMode.ForRead, False)
Dim myBTR As DatabaseServices.BlockTableRecord
myBTR = myBlkRef.BlockTableRecord.GetObject(DatabaseServices.OpenMode.ForRead)
If myBTR.Name = "title_blk_a3" Then ReadAttribute(oEnt.ObjectId)
myBTR.Dispose()
End If
End While
myDBt.CloseInput(True)
myTranst.Abort()
myTransMant.Dispose()
End Sub
Public Sub ReadAttribute(ByVal BlkId As DatabaseServices.ObjectId)
Dim BlkRef = BlkId.GetObject(OpenMode.ForRead)
For atb As Integer = 0 To BlkRef.AttributeCollection.Count - 1
Dim attrb As AttributeReference
attrb = BlkRef.AttributeCollection(atb).GetObject(OpenMode.ForRead)
'Debug.Print("Attribute Name:" & attrb.Tag & "---" & attrb.TextString)
If attrb.Tag = "AR" Then
area = attrb.TextString
ElseIf attrb.Tag = "JOB" Then
job_no = attrb.TextString
ElseIf attrb.Tag = "BLDG" Then
bldg_no = attrb.TextString
ElseIf attrb.Tag = "PH" Then
phase_no = attrb.TextString
ElseIf attrb.Tag = "QTY" Then
part_qty = attrb.TextString
ElseIf attrb.Tag = "PART" Then
part_mark = attrb.TextString
End If
attrb.Dispose()
Next
BlkRef.Dispose()
End Sub
Public Sub Show_Data(Optional ByVal Arrynew As Array = Nothing, Optional ByVal FormHdr As String = "", Optional ByVal GridTable As Data.DataTable = Nothing, Optional ByVal GridDataRow() As DataRow = Nothing, Optional ByVal IsDialog As Boolean = False)
Dim GridShowForm As New GridForm
GridShowForm.Text = FormHdr
If Not Arrynew Is Nothing Then
With GridShowForm.DataGridView1
.ColumnCount = Arrynew.GetUpperBound(0) + 1
.RowCount = Arrynew.GetUpperBound(1) + 1
For a As UShort = 0 To Arrynew.GetUpperBound(1)
For b As UShort = 0 To Arrynew.GetUpperBound(0)
.Rows(a).Cells(b).Value = Arrynew(b, a)
Next b
Next a
End With
ElseIf Not GridTable Is Nothing Then
GridShowForm.DataGridView1.DataSource = GridTable
ElseIf Not GridDataRow Is Nothing Then
With GridShowForm.DataGridView1
.ColumnCount = GridDataRow(0).ItemArray.GetUpperBound(0) + 1
.RowCount = GridDataRow.Length
For a As UShort = 0 To .RowCount - 1
For b As UShort = 0 To .ColumnCount - 1
.Rows(a).Cells(b).Value = GridDataRow(a).Item(b)
Next b
Next a
End With
End If
If IsDialog Then
GridShowForm.ShowDialog()
Else
GridShowForm.Show()
End If
End Sub

Private Sub frmmain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If purpose = "yes" Then
bt_cut_list.Text = "PIECE SKETCHES"
lblCaption.Text = "PIECE SKETCHES"
ElseIf purpose = "unique&piece" Then
create_cut_list()
Me.Close()
Else
bt_cut_list.Text = "CUT LIST"
lblCaption.Text = "CUT LIST"
End If


End Sub
End Class


Regards,

R.Ranjith
Valued Contributor
ognyandim
Posts: 59
Registered: ‎05-21-2008
Message 5 of 17 (1,425 Views)

Re: Unloading DLL

01-03-2012 12:01 AM in reply to: ranjith0326

Hello,

Place a break point at

 

Private Sub frmmain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

 

and step through to find where it brakes. If frmmain_Load is the first thing that loads, because from this code I cant guess.

 

I dont see any command method or command class attributes in your code - Where is the entrance point?

 

Read this first and try to refactor your code : http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=18162797

 

Go through the other tutorials on :

http://usa.autodesk.com/adsk/servlet/index?id=18162650&siteID=123112

 

Try searhing http://through-the-interface.typepad.com/ - there are lots of examples.





 

For the next time - dont paste your code like that, because it is a bit messy and I have problems loading it in VS. Better just zip your .vb file and attach it so we will be able to unzip it and automatically load it into VB with all the code style that enchances readability.

 



Valued Mentor
KerryBrown
Posts: 269
Registered: ‎11-29-2008
Message 6 of 17 (1,417 Views)

Re: Unloading DLL

01-03-2012 12:32 AM in reply to: ognyandim

ognyandim wrote:

Jeff, there is no need to be rude and produce spam on this forum.

 

In general I still dont know a way for unloading a .NET dll from AutoCAD.


First, Jeff was not being rude.
There is no way to unload a DLL from AutoCAD ! ... this has been documented innumerable times.

 

... and without knowing the error or seeing the code the question is unanswerable.

 

Regards

kdub

 

 

//-------------------------------------------------------

class keyThumper<T> : Lazy<T>;      another  Swamper

Contributor
ranjith0326
Posts: 24
Registered: ‎04-16-2011
Message 7 of 17 (1,413 Views)

Re: Unloading DLL

01-03-2012 12:36 AM in reply to: ognyandim

Dear ognyandim,

 

My Zip file size is too large ..

i cant able to attach file here..

 

Im checking the code as per your instructions..

 

Thank & Regards,

 

Ranjith


Regards,

R.Ranjith
Valued Contributor
ognyandim
Posts: 59
Registered: ‎05-21-2008
Message 8 of 17 (1,407 Views)

Re: Unloading DLL

01-03-2012 01:25 AM in reply to: ranjith0326

You can always create an account at sites like mediiafire.com and upload it there and send a link.

Contributor
ranjith0326
Posts: 24
Registered: ‎04-16-2011
Message 9 of 17 (1,405 Views)

Re: Unloading DLL

01-03-2012 01:31 AM in reply to: ognyandim

http://www.mediafire.com/?um6c09u92ffci7l

 

Above one is the link for my code

Regards,

R.Ranjith
Valued Mentor
jeff
Posts: 330
Registered: ‎05-12-2009
Message 10 of 17 (1,387 Views)

Re: Unloading DLL

01-03-2012 04:28 AM in reply to: ranjith0326
I was not trying to be rude just was being short.
 

 

Do not have crystal reports and a bit of code to try to skim through quickly.

 

 

Try adding this class

 

Imports System
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.EditorInput

<Assembly: ExtensionApplication(GetType(cut_list_class.AppLoad))> 

Namespace cut_list_class

    Public Class AppLoad
        Implements IExtensionApplication

        Public Sub Initialize() Implements IExtensionApplication.Initialize

        End Sub

        Public Sub Terminate() Implements IExtensionApplication.Terminate

        End Sub
    End Class

End Namespace

 

  Place a breakpoint at intialize method and see if you can step through and find where error happens.

You can also find your answers @ TheSwamp
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.