.NET

Reply
Contributor
AdrianSaf
Posts: 27
Registered: ‎08-05-2014
Message 1 of 2 (141 Views)
Accepted Solution

Insert WD_M block programmatically

141 Views, 1 Replies
08-06-2014 02:26 AM

Hello,

 

I'm new to working with AutoCAD so this might be a really silly question.

 

How can I programmatically add the electrical WD_M block using ObjectARX and the COM API?

 

I assume I can read the WD_M dwg and then insert each block from it to my dwg. Is that the way to go?

 

Does the API offer the complete path to the WD_M dwg? How can I tell from what folder I should get the WD_M from (JIC1/JIC125)?

 

Thank you.

 

Found a way to do it by calling the LISP ACADE api.

 

 

ResultBuffer resBuf = new ResultBuffer();
resBuf.Add(new TypedValue((int)LispDataType.Text, /*MSG0*/"c:ace_GBL_wd_m")); //Lisp function to call
resBuf.Add(new TypedValue((int)LispDataType.Int16, 1)); // options
ResultBuffer res = Application.Invoke(resBuf);

 

Contributor
AdrianSaf
Posts: 27
Registered: ‎08-05-2014
Message 2 of 2 (84 Views)

Re: Insert WD_M block programmatically

08-11-2014 01:03 AM in reply to: AdrianSaf

 

Found a way to do it by calling the LISP ACADE api.

 

 

ResultBuffer resBuf = new ResultBuffer();
resBuf.Add(new TypedValue((int)LispDataType.Text, /*MSG0*/"c:ace_GBL_wd_m")); //Lisp function to call
resBuf.Add(new TypedValue((int)LispDataType.Int16, 1)); // options
ResultBuffer res = Application.Invoke(resBuf);

 

Need installation help?

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