undefine AutoCAD commands using .NET - c#

I am looking for a way to customize the AutoCAD move command. I have tried the code in the link below without sucess. I received no errors executing it, it just ran the normal AutoCAD open command.
http://through-the-interface.typepad.com/through_the_interface/2007/03/replacing_the_o.html
I also tried this link with no positive results either.
http://adndevblog.typepad.com/autocad/2012/05/disable-certain-commands-for-a-given-entity-or-a-class-in-net.html
The question posted here titled "Override/Customize AutoCAD Command" suggested using overrules. I am not convinced that this is the right approach either. I am certain that I'm missing something and cannot find sufficient information to determine just what it is. A link to it would be greatly appreciated.

Related

using free database coolprop in my c# program

I would like to use the following in my program, so i can use it's functions:
http://www.coolprop.org/coolprop/wrappers/Csharp/index.html
However i have no idea how to do the things explained in the link above.
I was able to instal the third-party nuget. But i would like to use the original CoolProp and it's functions rather. So i was looking at the "pre-compiled binaries" and "user-compiled binaries" but can't seem to figure it out... I have zero experience in this and have been looking all over the internet for some tutorials etc. without any luck.
basicaly i followed the following:
coolprop explenation
so i do this:
developer comand promt input
and get this result:
devoloper command prompt result
Ran command seperate, first line is ok i think, second throws errors:
separeted lines
folder where i stored the files:
Folder structure
I hope someone here can help me, thanks in advance.
greetings
Matti

Where will using Interop fail? Don't use Office.Interop if Office is not installed. late binding?

My windows forms application uses Novacode DocX to write a document from a template. The Novacode portion of the project works perfect and the file saves. The issue is that when I load the document the field/s (Table Of Contents) are not updated when the Novacode portion adds headings and such.
I could, and did, write a macro to update fields on open. This would solve the problem, but not everyone that will use my application will have this macro. I can't save the file as a .docm file with the macro attached for various reasons (assume file must be ".docx").
What I've found is that the Microsoft.office.interop.Word assembly will allow me to call "Fields.Update". My understanding is this will do the trick, but I can't block users that don't have word installed from running my application. My understanding is that if I am "Using Microsoft.Office.Interop.Word", or have it in my references that the application won't run if someone doesn't have word.
So I have code that checks if word is installed. If I run this, and it is installed, can I then use "Late Binding" to run interop code? Other related questions, have replies that point to "NetOffice" as a way to run interop without checking if word is installed.
I'm trying to make this as comprehensive as possible with my research. My question is very similar to this one "
how do I easily test the case where my C# application can't find an external assembly?". I would hope this issue can soon be solved for everyone, but I'm not sure it will be.
Side note, if anyone knows a way to update the fields, or even just the existing TOC, of a word document that is saved in the ".docx" format without having word installed that would be awesome to know, and would circumvent my whole issue. Although I would still like to know the answer to the interop question.
Also this is my first real question on StackOverflow, if you have tags to suggest please do so along with your answer. If you have feedback on how I ask my question, I will accept that too, but please don't close/delete the question without any answers. I linked to questions that are similar, but those questions have not gotten responses in a while. I believe I have done everything according to the rules.
This is more of an answer to your "if anyone knows a way to update the fields, or even just the existing TOC, of a word document that is saved in the ".docx" format without having word installed" question, but you might want to look in to the Open XML SDK for Office.
This will let you modify .docx files without having any dependency on having Word installed.
I found this tutorial which I think is doing almost exactly what you are wanting do do using the Open XML SDK.
Many things to say, but I think I found my answers
The main question was if I add the reference to "Microsoft.Office.Interop.Word" and the client running the application does not have word, where will the application fail? My understanding now, is that it will not fail on launch if the client does not have word. It will, however, fail when the code that uses the "Office.Interop.Word" is reached.
The way to prevent this, is a simple registry check method. I used a variation of This method to check the registry. Then before any of my code that uses the "Office.Interop.Word" code is run, I check if the client has word in the registry. If they don't have word, I take the proper notification actions for my application. I also surrounded the "Office.Interop.Word" code in a "try catch" exception block as a double safe measure. In my code the exception would mean word is not installed. A variation of the code using "Office.Interop.Word" I used to update fields can be found here.
Novacode DocX can support Docm files if you change the code yourself. I did not want to, and didn't use a docm file. Docm files have security warnings associated to them when emailed. So an auto updating macro is out of the question.
-Octopus Emoji is Celebrating

How to compile C# file without a project?

Is there a way in VS2013 to compile a C# file without a project or solution?
This is useful, e.g. in editing some C# code quickly while preparing a Stack Overflow answer while scrubbing corporate IP from the file (without risking any harm to the "real project").
The build toolbar is grayed-out.
I know one can occasionally see squiggles for errors.
Any other simple ideas?
You can use https://dotnetfiddle.net/
You can specify different things in it. It is best for writing fast answers, also you can post link with your saved work. It is similar to jsfiddle if you aware of it.
You can use Snippet Compiler. You can download it from below URL.
http://www.sliver.com/dotnet/SnippetCompiler/
Its a stand alone light weight small application.
If you have Mono C# installed then C# REPL is awesome tool to execute small chunk of c# code.
http://www.mono-project.com/docs/tools+libraries/tools/repl/

How to programmatically create custom comment tokens

I am writing a small Visual Studio addin to let the user use more features of the comment tokens (TODO, HACK, etc.). For this I want to extend Visual Studio with new commands (such as TODISCUSS, TODELETE, FIXME, TESTME, etc.). I'd like to do this programmatically when my addin starts.
I already found out how to do this manually: http://msdn.microsoft.com/en-us/library/ekwz6akh%28v=vs.80%29.aspx
Does anyone have an idea how this could be done via the API?
Any ideas or suggestions would be appreciated!
Edit :
See this MSDN Link perhaps digging around in TaskList will get you somewhere.
Original Post :
It's not very clear (to me :) what exactly you want to do. Is it: find, edit, or refactor the tokens and then do something else with the sources? I can suggest this article on Code Project (NRefactory).
Using NRefactory you can do anything and everything with the source files including locating the tokens you want and doing stuff with them. You will also know the files you found them in, line numbers etc.
Perhaps you will be able to use Nrefactory to do all the heavy lifting as far as sources are concerned.

zeromq and c# binding

I am a C# developer and I am learning zeromq api right now. By reading various articles, I found that I have to use C# Bindings.
The main problem for me is where to start. I followed steps on this link and put libzmq.dll under C:\windows\system32\ and I have clrzmq.dll and clrzmq-ext.dll referenced in visual studio project. I tried first two samples from zeromq guide and it works fine.
I got confused when I show these links.
link1
link2 (please scroll down to example.
As shown in link1, I don't see any method like Context.CreateContext() and CreateSocket()
As shown in link2, subscriber does not have event that notifies about the received data.
Can someone point why I am not seeing above things on my machine?
Thanks,
mChicago
In your question you say there is no Context.CreateContext()
If you are using the clrzmq bindings, the call is
using(var context = ZmqContext.Create())
...
Perhaps you misread it?
You second question is actually about some ambiguity on the C# bindings page. The example you point out is actually for the ZeroMQ Interop library, and not clrzmq (which is referenced at the top of the page.) The defining line between those two sections is kind of confusing.
Hope this helps.

Categories