eproo Posted December 1, 2008 Posted December 1, 2008 Hello! I have a liitle problem with my programm. I need to create programm that is making a AutoCAD drawing from a windows form. I Alrady got the everything done, but have one small problem: I can send command to autocad only once per my programm is running, if i try to send two commands it crushes and give me error that Call was rejected by callee. I mange to find that it is becuse of the time the send command need to go to autocad. I also find solution I done the solution and it actualy work, but there is another problem now, actualy still same. The MessageFilter.Register(); works and its stops the crush and the error message are not showing, but nothing hapens, i mean the next send command aint working, it just stops working, i mean the command aint sending. Here is the piece of my code: public void RenameLayoutu() { MessageFilter.Register(); acadDoc.SendCommand("_layout r Layout1"); SendKeys.Send("{ENTER}"); acadDoc.SendCommand("mylayout"); SendKeys.Send("{ENTER}"); MessageFilter.Revoke(); } It is to rename one of the layouts in the document. First command working, then enter key sending, and after that nothing, there aint crush, programm is still runing and i can draw in autocad manualy everything is working exept sending of second command. Thank to anyone who will help. Best regards NILS. Quote
borgunit Posted December 1, 2008 Posted December 1, 2008 Have you tried through the objects in AutoCAD's object model rather than SendCommand. Timing becomes an issue with SendCommand since AutoCAD gives no actual feedback to the programming language you are using. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.