Insert Block In Autocad Using C#

Insert Block In Autocad Using C#

sundaram1087
Advocate Advocate
1,120 Views
2 Replies
Message 1 of 3

Insert Block In Autocad Using C#

sundaram1087
Advocate
Advocate

Hi

 

 I tried to insert the block in autocad by Using C# in COM Object method. in that am getting error that "Key not found"

 

This is my function

 

public AcadBlockReference NewblockInsert(Double[] Inspt, string BlockName )
{
double Dimsacle = 1;
AcadBlockReference BlkInsert=null;
try
{
BlkInsert = (AcadBlockReference)CadDoc.ModelSpace.InsertBlock(Inspt, BlockName, 0, 0, 0, 1);


}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
return BlkInsert;
}

 

Could you please provide the solution for that

 

Regards

Shunmugasundaram

 

0 Likes
1,121 Views
2 Replies
Replies (2)
Message 2 of 3

ilia.borisov
Collaborator
Collaborator
Are you trying to insert already existing block or you first create block and then try to insert it with that method?
0 Likes
Message 3 of 3

sundaram1087
Advocate
Advocate

Hi

 

Existing block only

 

Regards 

Shunmugasundaram

 

0 Likes