.NET

Reply
Contributor
AlexSu
Posts: 25
Registered: ‎02-14-2006
Message 1 of 8 (243 Views)
Accepted Solution

Lock an Instance of AutoCAD object

243 Views, 7 Replies
12-02-2013 05:11 PM

Hi Everyone!

 

My question is kind of simple. How do I lock down an AutoCAD instance object that I created? This is so that the AutoCAD instance that I created can work in the background without responding to user if they open up another drawing. That drawing that the user open has to be opened in another AutoCAD instance.

Something similar in Excel is Application.IgnoreRemoteRequests.

 

Thanks,
Alex

Regards,
Alex Su
Autodesk Autocad & Inventor 2012 Certified Pro
Autodesk Inventor 2012 Certified Instructor (ACI)
Autodesk Inventor 2012 Certification Evaluator (ACE)

write some code that will create a script file and feed it to accoreconsole.exe

Valued Mentor
jeff
Posts: 338
Registered: ‎05-12-2009
Message 2 of 8 (234 Views)

Re: Lock an Instance of AutoCAD object

12-02-2013 05:57 PM in reply to: AlexSu

write some code that will create a script file and feed it to accoreconsole.exe

You can also find your answers @ TheSwamp
Contributor
AlexSu
Posts: 25
Registered: ‎02-14-2006
Message 3 of 8 (225 Views)

Re: Lock an Instance of AutoCAD object

12-02-2013 06:45 PM in reply to: jeff

Hi Jeff,

 

Thanks for the response! Accoreconsole.exe seems to be a very good solution for batch processing and for what I'm doing.

I will try to find out more about this Accoreconsole and try to work in that direction.

Did not know that something like this exists! Thanks!

Regards,
Alex Su
Autodesk Autocad & Inventor 2012 Certified Pro
Autodesk Inventor 2012 Certified Instructor (ACI)
Autodesk Inventor 2012 Certification Evaluator (ACE)
Valued Mentor
jeff
Posts: 338
Registered: ‎05-12-2009
Message 4 of 8 (209 Views)

Re: Lock an Instance of AutoCAD object

12-02-2013 09:29 PM in reply to: AlexSu

At bottom of post at link below is a attachment that was for an example to run one instance for each core and start another when one finishes, to show a problem having that caused active program to lose focus whenever a new instance was started.

 

http://www.theswamp.org/index.php?topic=41948.msg471132#msg471132

You can also find your answers @ TheSwamp
Contributor
AlexSu
Posts: 25
Registered: ‎02-14-2006
Message 5 of 8 (202 Views)

Re: Lock an Instance of AutoCAD object

12-02-2013 11:39 PM in reply to: jeff

Hi Jeff,

 

Thank you for your reply. I will go through the code that you posted in that forum and study it. I already have code that does multithreading on multiple AutoCAD instances (5 to be exact) and does the job independant of each other (each receives command and data from network clients to process drawings). That's why I want to lock all those instances so that user can't accidentally make one of those instances visible. Imagine running 5 instances of full AutoCAD in the background... takes up 1GB of ram even when it's not doing anything. This accoreconsole might just be what I needed as an alternative although I'm not too sure at this point that this will work or not for what I'm trying to acheive but It's worth a try. Thanks again!

Regards,
Alex Su
Autodesk Autocad & Inventor 2012 Certified Pro
Autodesk Inventor 2012 Certified Instructor (ACI)
Autodesk Inventor 2012 Certification Evaluator (ACE)
Valued Mentor
jeff
Posts: 338
Registered: ‎05-12-2009
Message 6 of 8 (200 Views)

Re: Lock an Instance of AutoCAD object

12-02-2013 11:50 PM in reply to: AlexSu

Just so you know if a drawing is open accoreconsole will open it and just sit there so you might want to first try to open a filestream with noshare, but once closed still coud get opened before accoreconsole opens it.

You can also find your answers @ TheSwamp
Valued Mentor
jeff
Posts: 338
Registered: ‎05-12-2009
Message 7 of 8 (194 Views)

Re: Lock an Instance of AutoCAD object

12-02-2013 11:58 PM in reply to: jeff

The previous example probably not a good example to look at it and was more for producing the side effects

 

This woud be better

 

http://adndevblog.typepad.com/autocad/2012/04/getting-started-with-accoreconsole.html

 

You can also find your answers @ TheSwamp
Contributor
AlexSu
Posts: 25
Registered: ‎02-14-2006
Message 8 of 8 (192 Views)

Re: Lock an Instance of AutoCAD object

12-03-2013 12:08 AM in reply to: jeff

Hi Jeff,

Thanks for the reminder. I normally finish creating the drawing first before saving it to a file, that way there's no way that the use could open that drawing which is still processing but I'll keep this in mind though.

Regards,
Alex Su
Autodesk Autocad & Inventor 2012 Certified Pro
Autodesk Inventor 2012 Certified Instructor (ACI)
Autodesk Inventor 2012 Certification Evaluator (ACE)
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.