Author Topic: Screw it I give up  (Read 10380 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6150
Screw it I give up
« on: November 26, 2014, 03:20:06 AM »
PLEASE READ
Please let me know if interested, and if not I will not waste my time because this a very tiny portion and there is much more but just started with this because I had to start somewhere. If people are interested I will continue to add more and more each day except for this week because it is Thanksgiving.
All I ask is if you notice something please point it out, and if you have a better approach or insight please share, which I'm sure many of you do.

The code and links to download project template are in attached files and are created using Markdownpad 2 which can be viewed with any internet browser. Please let me know if it makes it easier to read and understand or suggest a better method.
Again this is just a initial test to see if anyone is interested so I know if it is worth spending the time to explain and post, and also figuring out a good way to provide and explain it so its easy to use and understand.
With that said or actually typed.


I am tired of fighting a unwinnable battle, and I will not go into it, but

I will be posting a bunch a stuff that I use daily and has worked for a years consistently.
For example
  • Library code - used for speeding up coding
  • Deploying code on server and making easy to update so user have latest build.
  • Layer Mapping - Where I map commands and blocks to certain layers and can create as many maps as wanted so depending on map set currently for a drawing commands and blocks will use layer specified.
  • Handling standards so everyone uses same styles, etc..
  • Exploiting sheet set files to use as a databse and taking advantage of field evalutor to keep data linked.
  • For Blocks keeping atts horizontal or readable, using custom snaps, etc..
  • a bunch more but just first things to come to mind.
Here are 2 tools built recently using code that each took less than 30 mins to create and have work great.

This is like MEP add device window where basically you point this to a folder with Block Library files and use it to insert blocks


This one is so you can edit all attributes at one time for a certain block, and also copy to clipboard to paste in excel, wblock out, zoom to each one, and does not lock drawing UI so can still edit drawing it becomes disabled if drawing is not active or closes if drawing closes. That is easily handled by PerDocData class that is mentioned in attached files.



Attached are three html files to get this started

1 - Default Project.html - contains a quick overview of project setup and a link to download a solution set-up with references and structure, etc....
2 - Getting SymbolTablesRecords.html - This is just getting set up for iterating SymbolTables and getting SymbolTablesRecords and some other points like  if  Dependent Records are not needed how dependency can be determined without opening the object and just using the Objectid properties.
3 - AcCoreMgdExtensions intial.html - Contains intial setup for easier writng to commandline and creating CommandClasses and data associated.


Before it gets too deep I think I have an idea how to handle Transactions better, so they can be used easily and not worry if from Document, Database, a Side Database, Transaction or OpenCloseTransaction, etc....
« Last Edit: December 04, 2014, 02:49:56 PM by Jeff H »

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: Screw it I give up
« Reply #1 on: November 26, 2014, 07:02:57 AM »
Thanks for sharing Jeff!


I like the use of the .html files for viewing and explaining what you are doing.  It also makes it easier to copy/paste code.


Keep them coming!
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Screw it I give up
« Reply #2 on: November 26, 2014, 07:53:31 AM »
Jeff,
Have you tried this.
Works in VS 2013

https://visualstudiogallery.msdn.microsoft.com/98fef791-eb65-4cdf-bf84-077b98c234cf


ADDED:
That may not be the correct one.
There are a couple of add-ons that do a HTML Markup direct from selected code in the VS IDE.


This is the result ...

« Last Edit: November 26, 2014, 08:26:19 AM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Screw it I give up
« Reply #3 on: November 26, 2014, 10:19:19 AM »
Thanks, Jeff! Sure wish I had something like this when I first decided to start using c#. And even after all this time, I am still learning from your posts!

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
Re: Screw it I give up
« Reply #4 on: November 26, 2014, 10:31:05 AM »
...
There are a couple of add-ons that do a HTML Markup direct from selected code in the VS IDE.
...

Why not use DoxyGen?
http://www.doxygen.org

Good link: http://stackoverflow.com/questions/2028264/visual-studio-with-doxygen-for-documentation-or-should-we-use-something-else
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

BlackBox

  • King Gator
  • Posts: 3770
Re: Screw it I give up
« Reply #5 on: November 26, 2014, 10:54:29 AM »
Thank you, Jeff.

The amount of time and effort you put into tasks like this, that help others, is greatly appreciated.

I've only had a chance to skim some of this (seriously, WTF is it with deadlines before Thanksgiving!? Reviewers are already gone on vacation, and nobody will look at the plans for a week. :roll: ), but it looks to be very useful as I continue to learn .NET generally, and C# specifically. :redbull: (too early for beer here; drink'em if you got'em)

Cheers
"How we think determines what we do, and what we do determines what we get."

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: Screw it I give up
« Reply #6 on: November 30, 2014, 11:23:10 PM »
Thanks Jeff, there's a mountain of experience and toil in there, your efforts and generosity are much-appreciated. Count me in as interested. Would you consider posting the code to a Git/Hg repo so we can send you pull-requests for updates?

I've really got to tidy up my library stuff and post it here too, some day soon. I should also post some of my unit-testing stuff too (I'm typing this here as a note-to-self and as a commitment to actually do it).

For Visual Studio docs I use Atomineer.

cheers
Ewen

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Screw it I give up
« Reply #7 on: December 01, 2014, 04:22:52 AM »
Markdown is not only for html but can be converted to pdf and many other formats.
Quote
Markdown is a plain text formatting syntax designed so that it can be converted to HTML and many other formats using a tool by the same name. Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.
MarkdownPad 2 is just an editor that makes the processes easier to use.
For example in MarkDown
#Heading1#(Optional to add to the end)
##Heading2##
###Heading3###
**Bold
I looked at forums for SMF and looks like they have no plans to adopt the ability to include MarkDown. If they did you could format your post like attached files.

Reading your post now makes me think I being a little stoopid and should use something that could be integrated with code for documentation. Right now its completely separated making it a pain to manage. For example the very USEFUL geometry extensions by gile(thanks again gile) but can't remember what he used but he mentions it in an post here that I will look for.
So we got
http://www.doxygen.org
Atomineer
https://visualstudiogallery.msdn.microsoft.com/98fef791-eb65-4cdf-bf84-077b98c234cf
http://sandcastle.codeplex.com/

 
As far as GitHub, the actually library and AddinLoader that loads it, etc.. are in a repository on GitHub, my plans were to get some feedback on project setup along with a couple other things and refactor some things out to make it more "community friendly". Once that straighten out then make it public or maybe keep it private and PM me email address associated with github account and add anyone who wants to join and some others for the different roles. The second way would be to keep a more of a "Swamp" project.
 
Unless Autodesk builds a tool for it and is maintained I can not honestly ever see Unit-testing for AutoCAD becoming reality other than someone spending a huge amount of time just to find out it will take a huge amount to maintain and spend a huge amount of time to update each year.
The examples I have seen have been so narrowed in just to show a example of how it can be achieved, have made think holy sh*t that would be so much work to create a platform that would be useful.

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
Re: Screw it I give up
« Reply #8 on: December 01, 2014, 08:26:36 AM »
Would a "new project wizard" be of any use to this effort? ...My folder structure is a bit abnormal so I built myself a nice little wizard to create all the new project stuff (directories, README files, CMake files, classes, implementation files, etc.) I could build a similar wizard for the effort.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Screw it I give up
« Reply #9 on: December 01, 2014, 12:17:29 PM »
Would a "new project wizard" be of any use to this effort? ...My folder structure is a bit abnormal so I built myself a nice little wizard to create all the new project stuff (directories, README files, CMake files, classes, implementation files, etc.) I could build a similar wizard for the effort.
That would be awesome and here's a wizard with many options that freely available.
http://spiderinnet1.typepad.com/


Jeff H

  • Needs a day job
  • Posts: 6150
Re: Screw it I give up
« Reply #10 on: December 01, 2014, 12:23:37 PM »
Adding this to get closer to start seeing some actual examples might use in real world situations, but still needs more.

But the attached file is for
Setting Environment Variables
Setting System Variables
Temporarily Setting System Variables and reverting back to initial value.
Adding, removing, inserting SupportPaths, ToolPalettes, etc as if they were a collection and not a string with paths separated with ";"


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Screw it I give up
« Reply #11 on: December 01, 2014, 12:29:12 PM »
...
There are a couple of add-ons that do a HTML Markup direct from selected code in the VS IDE.
...

Why not use DoxyGen?
http://www.doxygen.org

Good link: http://stackoverflow.com/questions/2028264/visual-studio-with-doxygen-for-documentation-or-should-we-use-something-else


I had the idea that the html of the code could be used in your html to display coloured formatting.

//-------------------------------------------

Would a "new project wizard" be of any use to this effort? ...My folder structure is a bit abnormal so I built myself a nice little wizard to create all the new project stuff (directories, README files, CMake files, classes, implementation files, etc.) I could build a similar wizard for the effort.
That would be awesome and here's a wizard with many options that freely available.
http://spiderinnet1.typepad.com/

spiderinnet may need some encouragement to update the wizard for current AutoCAD builds.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
Re: Screw it I give up
« Reply #12 on: December 01, 2014, 01:42:00 PM »
...

Would a "new project wizard" be of any use to this effort? ...My folder structure is a bit abnormal so I built myself a nice little wizard to create all the new project stuff (directories, README files, CMake files, classes, implementation files, etc.) I could build a similar wizard for the effort.
That would be awesome and here's a wizard with many options that freely available.
http://spiderinnet1.typepad.com/

spiderinnet may need some encouragement to update the wizard for current AutoCAD builds.
humm... Good point Kerry. I'll need to build a wizard that can read a "recipe"--of sorts-; that way only the recipe (and the few associated files) can/needs to be updated. Not to mention, many recipes can be built for several different conditions (which is a plus). I have a few big areas of concern right now so I will put my thinking cap on.

...I think I have may have just grabbed a tiger by the tail. :)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
Re: Screw it I give up
« Reply #13 on: December 01, 2014, 01:59:37 PM »
That spiderinnet wizard looks like it's a VS addon. I was thinking of a standalone exe file. Is that a deal breaker?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: Screw it I give up
« Reply #14 on: December 01, 2014, 03:56:54 PM »
It wouldn't be a deal breaker for me.  If you could start visual studio and load the project in a stand alone would the be much difference?
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013