Author Topic: Lets write a complete real world add-in  (Read 16758 times)

0 Members and 1 Guest are viewing this topic.

Jeff H

  • Needs a day job
  • Posts: 6150
Lets write a complete real world add-in
« on: July 09, 2012, 01:09:22 PM »
I think it would be a great learning experience to create a small useable add-in or little tool as if it were going to the app store.
From beginning to deployment.
 
To make sure it is done for learning experience and not me just trying to get others to create a tool, maybe people could post some suggestions or a vote, but I would stay out of the decision process.
 
 
I know people are busy and have obligations but hopefully we could some people to participate.
 
Hopefully some of you knowledgeable and experienced guys would be willing to throw in suggestions and tips and comments to help keep it steered in a decent direction and keep it from gettin to un-maintable.
 
We could break it up it smaller parts and assign certain parts to people willing to participate.
 
Hopefully some good learning experiences could come from it and show insight on looking at the project at different levels from the big picture down to a expression.
 
Possibly some other useful things could come from it as creating some functions that will test the code on a library of drawings that have many different scenarios locked layer, xrefs attached, different UCS's, different versions, etc...
Using the functionality from commandline vs form or ribbon.
Used in different flavours MEP, Civil, etc......
 
Anyone intrested?
 
 

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Lets write a complete real world add-in
« Reply #1 on: July 09, 2012, 01:53:56 PM »
As always, I could use the experience in project management.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Re: Lets write a complete real world add-in
« Reply #2 on: July 09, 2012, 03:40:49 PM »
What type are you thinking of?  A mobile version of The Swamp, perhaps?

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
Re: Lets write a complete real world add-in
« Reply #3 on: July 09, 2012, 05:42:17 PM »
How about an easy to use tool to save and/or close drawings.
I work with many drawings open at the same time. I use the tab add-in.
I know it has a save-all  close-all menu option but that isn't flexible enough.
I was thinking of a palette since this would be an application level (vs document level) program.
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions

bargool

  • Guest
Re: Lets write a complete real world add-in
« Reply #4 on: July 10, 2012, 03:16:36 AM »
I'm not very experienced, but I'm with you! Maybe we can use github or other vcs-hoster to collaborate.

vegbruiser

  • Guest
Re: Lets write a complete real world add-in
« Reply #5 on: July 10, 2012, 06:31:00 AM »
I'm more than happy to help. (Even if it's just for testing/debugging) - I have recently figured out how the autoload system works as far as addins are concerned..

waterharbin

  • Guest
Re: Lets write a complete real world add-in
« Reply #6 on: July 10, 2012, 09:15:45 AM »
Hi,Jeff.
I am not as good as you people. But since you want to write something, I wonder why you just end up in an "Add-In", why can't you go much farther! You can write a free open-source CAD instead. AutoCAD are everywhere,just like Microsoft. We are sick that there are just too many AutoCADs. We need some open-source CAD, just like Linux. Maybe you can be the next Linus Torvalds,because CAD is widely used all over the world.
I always want a basic CAD frame available. Anyone can change it to fit his own demand. I'm not good enough to do this, but maybe you can!

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Re: Lets write a complete real world add-in
« Reply #7 on: July 10, 2012, 11:25:00 AM »
What type are you thinking of?  A mobile version of The Swamp, perhaps?
Are we talking APPS here (as suggested by "app store" in the first post) or something for CAD?

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Lets write a complete real world add-in
« Reply #8 on: July 10, 2012, 12:26:37 PM »
What type are you thinking of?  A mobile version of The Swamp, perhaps?
Are we talking APPS here (as suggested by "app store" in the first post) or something for CAD?
Yes something that is general enough for a number of people to use, and nothing too big that would tough to handle, but thought it would be good for going through the whole process.

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #9 on: July 10, 2012, 12:27:01 PM »
Jeff,

It is very kind of you to volunteer to assist in developing an application, or plug-in by public suggestions. So, thanks for your generosity!

Perhaps it would be prudent to first identify a general direction for the scale, and scope, before we get lost in the weeds trying to be overly specific... To build a stand-alone application to function outside of AutoCAD, or to build a plug-in to function within AutoCAD?

IMO, there's more to be gained, and more users that will participate in the debugging, etc. if we go with the latter. A plug-in also allows for generalization in that we can develop a plug-in that is supported across multiple platforms (i.e., Vanilla AutoCAD, and verticals alike)... hopefully.

Generally speaking, there's a ton of things that can be done, or at least refined.
"How we think determines what we do, and what we do determines what we get."

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Lets write a complete real world add-in
« Reply #10 on: July 10, 2012, 12:33:42 PM »
Jeff,

It is very kind of you to volunteer to assist in developing an application, or plug-in by public suggestions. So, thanks for your generosity!

Perhaps it would be prudent to first identify a general direction for the scale, and scope, before we get lost in the weeds trying to be overly specific... To build a stand-alone application to function outside of AutoCAD, or to build a plug-in to function within AutoCAD?

IMO, there's more to be gained, and more users that will participate in the debugging, etc. if we go with the latter. A plug-in also allows for generalization in that we can develop a plug-in that is supported across multiple platforms (i.e., Vanilla AutoCAD, and verticals alike)... hopefully.

Generally speaking, there's a ton of things that can be done, or at least refined.
Good point as I do not know the difference between a add-in or plug-in.
It is very important to establish up front what we can.
Will think of some guidelines but was trying to stay out of it because I did not want people think I was trying to use their time for my personal gain.
Thanks for everyone's input.
 

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #11 on: July 10, 2012, 12:47:10 PM »
Good point as I do not know the difference between a add-in or plug-in.
It is very important to establish up front what we can.
Will think of some guidelines....

AFAIK,  (add-in == plug-in) , no?

In any event... equally important IMO, is to identify the development language in which this initiative will be coded, and which versions of AutoCAD will be supported (i.e., .NET Framework presuming this will include/consist of .NET?).

** Edit - I'd suggest selecting a database format, such as 2010 and newer, so .NET 3.5?

These two items alone will have a defining role as to which API Features have been exposed, and what limitations may, or may not exist for our collective efforts. Just a thought.

... was trying to stay out of it because I did not want people think I was trying to use their time for my personal gain.

Yes, of course. I'll try to address the thread rather than you specifically moving forward.
"How we think determines what we do, and what we do determines what we get."

flowerrobot

  • Guest
Re: Lets write a complete real world add-in
« Reply #12 on: July 11, 2012, 12:55:19 AM »
I like the idea of a more diverse Tab Add-on.

Although I do VB not C# I would like to help.



vegbruiser

  • Guest
Re: Lets write a complete real world add-in
« Reply #13 on: July 11, 2012, 03:51:56 AM »
I like the idea of a more diverse Tab Add-on.

Although I do VB not C# I would like to help.
As long as the code works correctly, it shouldn't really matter which language we choose - it could be any of the .NET languages..

vegbruiser

  • Guest
Re: Lets write a complete real world add-in
« Reply #14 on: July 11, 2012, 04:10:46 AM »
As luck would have it, on Monday I completed a "Successful Technical Authoring" Course and one of the topics they covered was the use of Mindmapping as a tool for capturing project ideas as well as for the production of documentation.

I'll reply again once I've found a suitable web-based solution that allows collaboration.

What does everyone else think?

vegbruiser

  • Guest
Re: Lets write a complete real world add-in
« Reply #15 on: July 11, 2012, 04:40:55 AM »
Here's a little something I just knocked up:

http://www.mindmeister.com/184561892 (password = th3Sw4mp) - if you don't have an account with them, you'll need to register in order to edit it; when you do so there's a (not-immediately-obvious) basic option that's at the bottom of the page which is free to use for up to 3 mind maps.

Add to it as you see fit.


MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Lets write a complete real world add-in
« Reply #16 on: July 11, 2012, 07:01:13 AM »
I'm in to help if we can stick with .NET 4.0+.  I just can't go backwards :wink:
Revit 2019, AMEP 2019 64bit Win 10

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #17 on: July 11, 2012, 10:52:22 AM »
I like the idea of a more diverse Tab Add-on.

Although I do VB not C# I would like to help.

So did I, when I started this thread:

Custom Drawing Tabs Interface... Where to Begin?

... However, as you'll see by reading the thread, this must be done in C++/ObjectARX.  :| *kicks dirt*

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

LE3

  • Guest
Re: Lets write a complete real world add-in
« Reply #18 on: July 11, 2012, 11:13:11 AM »
have seen so many intentions to write an app or whatever - hope this time you guys get together and put a team to work on this... all the best and luck!!!!!!!

57gmc

  • Bull Frog
  • Posts: 366
Re: Lets write a complete real world add-in
« Reply #19 on: July 11, 2012, 12:01:33 PM »
How about a bunch of text utilities? I've got a bunch of vba routines I've been meaning to port to .NET. Stuff like aligning text lines by decimal point and editing a bunch of text items at once in one dialog.

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
Re: Lets write a complete real world add-in
« Reply #20 on: July 11, 2012, 12:10:07 PM »
... However, as you'll see by reading the thread, this must be done in C++/ObjectARX.  :| *kicks dirt*
So what if we did it in a palette instead of tabs?
Think of the Layers palette but simpler . . . and with drawing files not layers obviously. :)
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #21 on: July 11, 2012, 12:28:43 PM »
... However, as you'll see by reading the thread, this must be done in C++/ObjectARX.  :| *kicks dirt*
So what if we did it in a palette instead of tabs?
Think of the Layers palette but simpler . . . and with drawing files not layers obviously. :)

I am certainly not the one who is deciding anything here, but my $0.02:

While hosting a WPF user control within an AutoCAD Tool Palette is perfectly feasible, a Tool Palette for this sort of functionality may not be the best 'vehicle', as it would require that the user either leave it open (Auto-hide off), or Docked in order to benefit from any sort of 'heads-up' information.

Perhaps, a merging a Ribbon Panel into the user's active Ribbon Tab on the Ribbon Tool Palette would prove useful... But again, this too requires that the user actually enable the Ribbon Tool Palette.

I'd love to see a new, or enhanced version of 'Drawing Tab' interface, but I'm not seeing something in that scope for this initiative. That sort of development effort requires organization, and coordination that I just don't see happening here. Call me pessimistic.
"How we think determines what we do, and what we do determines what we get."

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Lets write a complete real world add-in
« Reply #22 on: July 12, 2012, 07:36:43 AM »
What's the deadline to decide on what to write?  If we don't set some goals this will be another one of those posts that fades into cyberspace. 
Revit 2019, AMEP 2019 64bit Win 10

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #23 on: July 12, 2012, 08:43:55 AM »
Not sure if this is something others here would be interested in, but I came across this thread over at AUGI, and thought I'd share here given the intent to develop something that can be used across platforms, and used by many.

Basically, DWGPROPS are useful for storing easy to access information within a drawing, but as stated in the thread linked above, often times users in other departments, etc. need to view/consume this information via Windows Explorer.

In my limited testing, only the Summary Tab's Author Property is viewable in Windows Explorer, and not in the Author Column, only when hovering the cursor over a drawing. Not exactly intuitive, if you're trying to make things like 'Revision' etc. viewable.

I know (from Googling the topic) that Tony developed something for this some time ago, however, this initiative (if it's accepted/voted for) would support WinXP, Win7 (, and Win8? Ok, maybe later) in 32 & 64bit, and as I understand it having only given this some thought, and frankly being new to .NET in general... would need to include an Event Monitor that would sync the DWGPROPS fields with those of the Extended File Properties, no?

This could be a great learning experience for what I'd imagine is a relatively small task, in terms of complexity. Document has changes, check for DWGPROPS, if they exist, sync to Extended Properties prior to Close (and/or Save).

Just an idea, as I was contemplating if I could tackle this on my own, and thought others may enjoy the challenge too. Refinement(s), and other suggestions welcome!

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

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #24 on: July 12, 2012, 12:42:54 PM »
... Scratch that; JTB's been there, and done that:

http://www.jtbworld.com/DwgInfoTip.htm

:|
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #25 on: July 12, 2012, 02:09:39 PM »
*Bump*

So... does anyone else have any other suggestions?  :?
"How we think determines what we do, and what we do determines what we get."

flowerrobot

  • Guest
Re: Lets write a complete real world add-in
« Reply #26 on: July 12, 2012, 06:45:56 PM »
The ability to write custom properties with out the need to open AutoCAD ??

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #27 on: July 12, 2012, 08:38:38 PM »
The ability to write custom properties with out the need to open AutoCAD ??

Yep, like I said before.
"How we think determines what we do, and what we do determines what we get."

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Lets write a complete real world add-in
« Reply #28 on: July 12, 2012, 10:36:52 PM »
This should test the juices.

Rescale a Template drawing. ( assume the drawing is current active doc.)

Will deal with dims, linetypes and LinetypeScales, TextStyles, Units, Metric(etc)


The routine should work an a 'used' drawing too ..
Any existing displayed entitys should NOT change in size or location.  ....


.. just a thought.



and the next step :
a startup routine to set user settings.

:)

« Last Edit: July 12, 2012, 10:42:47 PM 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.

flowerrobot

  • Guest
Re: Lets write a complete real world add-in
« Reply #29 on: July 13, 2012, 12:38:40 AM »
The ability to write custom properties with out the need to open AutoCAD ??

Yep, like I said before.

The app that you linked reads the properties, There is no write ability of custom properties with out opening autocad or truedwg.

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #30 on: July 13, 2012, 05:58:38 AM »
The ability to write custom properties with out the need to open AutoCAD ??

Yep, like I said before.

The app that you linked reads the properties, There is no write ability of custom properties with out opening autocad or truedwg.

Perhaps I misunderstood... This is what I read. I am not sure how or why one would write custom properties without one of those installed (they'd still require RealDWG, no?). Maybe this just doesn't make sense to me due to the nature of my work.

In any event this may or may not help to clarify... I'm here to help, so if JTB's gimmick is not what you're after, and others are interested in contributing code to your idea, then I am in.  :-)

Quote from: JTB World's DwgInfoTip

About

    Enhance Your User's Experience with the New DWG Infotip Shell Extension.
    Show the DWG properties as an Infotip (tooltip) in Explorer or even from file dialog boxes within AutoCAD.



    Use DWGPROPS in AutoCAD and add information in the Summary or Custom tabs and it will show up just hovering above a DWG file.
    The Infotip will show the version of the DWG file, file size, date modified and most property information.
    PROPULATE allows quick, automated population of the Drawing Properties dialog data fields.
    No need to have AutoCAD installed. That means that everyone at your company can see this information.
    No need to open the drawing to know information like revision and other valuable information in the drawing.

<snip>

The freeware version is showing the DWG file format and title.



See also the complementary application DWG Columns for Explorer to show the information in columns in Explorer.
"How we think determines what we do, and what we do determines what we get."

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Lets write a complete real world add-in
« Reply #31 on: July 13, 2012, 01:56:32 PM »
I have been at a condo made for kids getting mildy liquored up and running around in splash pads and the beach with my kid for the last couple of days, but one of main reasons for doing this was to start creating a base library that could reused over and over for other projects.
 
So without much thought we first need to decide how to set up the base libraies.
We need to think about the changes with 2013 and plan on working with 2013.
Should we break it up into 2 dll's where one is the core and meant for running with the core console and another that is only needed for running inside AutoCAD.
 
The main point was to start collaborating to create little projects but in turn have other peoples input for creating library code.
 
For example with the open and close of drawings we need to know when drawings are created and destroyed, and instead creating something project specific we could do something like have an Interface IDocumentLifetime and it call DocCreated and DocDestroyed for each class that implements the interface.
 
I am on the road and hopefully it makes sense and will reply back later when get home and sobered up a bit.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Lets write a complete real world add-in
« Reply #32 on: July 14, 2012, 02:20:10 PM »
This should test the juices.

Rescale a Template drawing. ( assume the drawing is current active doc.)

Will deal with dims, linetypes and LinetypeScales, TextStyles, Units, Metric(etc)


The routine should work an a 'used' drawing too ..
Any existing displayed entitys should NOT change in size or location.  ....


.. just a thought.



and the next step :
a startup routine to set user settings.

 :)
I think that would be a good starter then the open close drawing thing , and will post something later with an example and expalnation on intent and and how I think this community could help produce some good learning material and hopefully with minor tweaks could be used for production code.
 but I tend to be a little tardish and do not quite understand how to scale them without changing size?
Overruling the WorldDraw?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Lets write a complete real world add-in
« Reply #33 on: July 14, 2012, 08:06:04 PM »
The intent would be to only change the annotative and presentation things.

The objects being presented remain at 1:1 ( as they should)


The border may change scale to contain the objects but that would be a seperate operation.
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.

vegbruiser

  • Guest
Re: Lets write a complete real world add-in
« Reply #34 on: July 16, 2012, 04:21:09 AM »
If it's any help, I've done some work in the past with dynamic blocks that we used for drawing borders (in Paperspace) - we had several size settings (A3 thru' A0) and were able to change the size according to the settings used on a block within ModelSpace. (the original aim of the add-in was to standardize as much as possible the output from a design team of around 20+ designers and it's worked pretty well for the best part of 6 years)

My original code for this was written in VBA for AutoCAD 2006, but I've been slowly porting it across to newer versions of AutoCAD using C#.NET

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Lets write a complete real world add-in
« Reply #35 on: July 16, 2012, 04:27:14 AM »
Thanks Alex,
 
That would would be great!
 
I am still trying to prepare a decent post and should have it ready today.
 

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Lets write a complete real world add-in
« Reply #36 on: July 25, 2012, 09:48:09 PM »
Hopefully people are still interested, and been busy but almost got little something together.
« Last Edit: July 25, 2012, 11:15:19 PM by Jeff H »

vegbruiser

  • Guest
Re: Lets write a complete real world add-in
« Reply #37 on: July 26, 2012, 07:01:45 AM »
Sounds good Jeff, I'll gladly take a look at whatever you've got. :)

BlackBox

  • King Gator
  • Posts: 3770
Re: Lets write a complete real world add-in
« Reply #38 on: July 26, 2012, 08:15:09 AM »
Hopefully people are still interested...

1+  :mrgreen:
"How we think determines what we do, and what we do determines what we get."

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Lets write a complete real world add-in
« Reply #39 on: July 26, 2012, 12:28:07 PM »
+2  :-)
Revit 2019, AMEP 2019 64bit Win 10

Irvin

  • Guest
Re: Lets write a complete real world add-in
« Reply #40 on: August 02, 2012, 09:59:10 AM »
Hi guys,

I like this idea alot. I've tryed to start a similar threat on the Autdesk Forum. Not alot of people where interested.
I'm hopeing the community is alot better here. So i'll post the code i've written when i've got a bit more time.

For now i'll post a link from the Autodesk discussion forum.

http://forums.autodesk.com/t5/NET/Discussion-Group-ClassLibrary-please-read/m-p/3021058#M23522

Irvin

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Lets write a complete real world add-in
« Reply #41 on: August 02, 2012, 06:09:19 PM »
I think it would be great to create some libraries that could used to help development. Unless correctly implemented it would waste people’s time and resources and fall flat on its face.
   
Probably the first thing to do is define what it is we would want to accomplish and see if it is feasible then decide if the knowledge and resources are available for accomplishing such a task.
 
I could be completely wrong but I think they did a pretty good job designing the .NET base libraries. So we could learn from their experiences, user studies, etc.. 
 
Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries  looks like good book and from looking through it they seem pretty honest by including examples how they messed and should have done it differently.
 
 


 
If we decide to attempt this type of project I would expect everyone to scrutinize any ideas and hopefully everyone understands it is not personal but for producing a better result.
I will be the first to admit that I do NOT possess the knowledge or experience to design such a framework and could be steering efforts in wrong direction so please reply with your thoughts.
 
 


 
To create a library that others would use this might be start for some guidelines and concepts. I missed many points and every situation differs and needs to be decided on a individual basis but maybe this will get feedback started to see if it could be accomplished, defining exactly what to accomplish, etc....
 
 


For starters a definition.
 
Framework – reusable object-orientated libraries.
 
 
 
Qualities of a well designed Framework
 
  • Simple & Powerful
  • If something seems complex or double guessing complexity should probably not add it. You cannot remove but you can always add.
  • Expensive
  • Money and/or many hours and resources will have to go into well designed Framework. This will not happen magically. 
  • Trade-offs   
  • There is no perfect design and will have trade-offs. There is no one answer that will fit all and need to decide which the correct ones are.
  • Borrows from the past
  • Designed to evolve
  • Consistent
 



Designing a Framework
 
  • Should be Progressive
  • Knowledge learned from simple less advanced scenarios should be able to transfer to more advanced scenarios
  • Scenario driven
  • Invest your time in most common used scenarios
  • Write code samples first for main scenarios then define the object model.
  • Before designing the object model write code samples first then create object model from samples. A good test would be for each person to write some code how they would imagine or like to write code for scenarios. Many standard object-oriented design methodologies were created to help maintain the result from implementing the design model, not for usability of a public API.
  • Limit Abstractions
  • Standard object-oriented design methodologies tend to produce many abstractions. Frameworks with many abstractions usually force the user to learn the architecture of the framework when they could just spend the time learning the AutoCAD framework directly. Keep in mind many design patterns and object oriented techniques were never created or claim to optimize for this type of design, but aimed toward internal architecture. Of course abstractions have their place in a framework design.
  • Principle of Low Barrier to Entry.
  • Easy identification of the right set of types and members for common programming tasks. A namespace that holds types for common scenarios should only contain the types needed. Types needed for more advanced uses could be in placed in sub-namespaces which the common types could also use.
  • Should be able to use types immediately and not require extensive intialization
  • Easy to find and fix incorrect uses of API, exceptions should clearly describe what needs to be done.
  • Principle of Self-Documenting Object Models
  • Naming
  • Exceptions
  • Strong Typing
  • Consistency
  • Principle of Layered Architecture
  • One method is to put high and low level types in different but related namespaces.
 

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Lets write a complete real world add-in
« Reply #42 on: August 02, 2012, 06:46:46 PM »
In that vein, "We, The Developers,..." would be doing the heavy lifting in the implementation.  Other developers would take the product and use it rather than having to spend time doing extra work in an area they don't necessarily want to be an expert in.  The immediate examples that spring to mind, are matrix calculations (used heavily in transformations) and advanced mathematics (vector math, for one).  These would be implemented as used in AutoCAD, with Intellisense and documentation to guide the inputs and outputs so the end user wouldn't necessarily know how to calculate the inverse of a 4x4 matrix of doubles but would be familiar with "I need to transform this line so its end points match these two known points"; or not know how to calculate the intersection of a plane and bounded line but be familiar with "I have a 3D face and a line object, where do they intersect?".
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Irvin

  • Guest
Re: Lets write a complete real world add-in
« Reply #43 on: August 06, 2012, 09:12:55 AM »
Hi guys,

In my opinion the first thing you need when developing an application is a place to store the applications settings. For example the default font for creating a new textstyle/dimstyle, a dwg for a dimblock for a new dimensionstyle or leader. This isn’t AutoCAD related but almost every app has settings. I think this could a great starting point.

When you write a class for creating a new textstyle this class should look at the settings what font the user wants when we create the textstyle for him.

My personal preference for storing these kind of settings are in a database (MS-SQL compact) or we need to extend the AutoCAD profile within the registry. I’m not a great fan of using the appsettings within a project. Because these settings a stored in the acad.exe.config file and not in the applications.config file.

Hope you guy’s share my thoughts about this issue. Let’s define are preferences and start coding!

Irvin

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Lets write a complete real world add-in
« Reply #44 on: August 06, 2012, 07:11:53 PM »
Depending on what you are trying to accomplish you could store them in AppData folder or search for Tony's Custom system variables.
Code - C#: [Select]
  1.  
  2.      public class MySettings
  3.     {
  4.         [XmlElement("num")]
  5.         public int MyNumber { get; set; }
  6.          [XmlElement("str")]
  7.         public string MyString { get; set; }
  8.         public void Save()
  9.         {
  10.             using (Stream stream = File.Create(SettingsFile))
  11.             {
  12.                 XmlSerializer ser = new XmlSerializer(this.GetType());
  13.                 ser.Serialize(stream, this);
  14.             }
  15.         }
  16.         public static MySettings Load()
  17.         {
  18.             if (!File.Exists(SettingsFile))
  19.                 return DefaultSettings;
  20.             using (Stream stream = File.OpenRead(SettingsFile))
  21.             {
  22.                 try
  23.                 {
  24.                     XmlSerializer ser = new XmlSerializer(typeof(MySettings));
  25.                     return (MySettings)ser.Deserialize(stream);
  26.                 }
  27.                 catch (InvalidOperationException)
  28.                 {
  29.                     stream.Close();
  30.                     File.Delete(SettingsFile);
  31.                     return DefaultSettings;
  32.                 }
  33.             }
  34.         }
  35.  
  36.         private static string SettingsFolder
  37.         {
  38.             get
  39.             {
  40.                 string folder = Environment.GetFolderPath(
  41.                     Environment.SpecialFolder.ApplicationData);
  42.                 folder = Path.Combine(folder, "MyCompany");
  43.                 folder = Path.Combine(folder, "MyApp");
  44.                 if (!Directory.Exists(folder))
  45.                     Directory.CreateDirectory(folder);
  46.                 return folder;
  47.             }
  48.         }
  49.         private static string SettingsFile
  50.         {
  51.             get
  52.             {
  53.                 return Path.Combine(SettingsFolder, "settings.xml");
  54.             }
  55.         }
  56.         private static MySettings DefaultSettings
  57.         {
  58.             get
  59.             {
  60.                 return new MySettings
  61.                 {
  62.                     MyNumber = 0,
  63.                     MyString = "",
  64.                 };
  65.             }
  66.         }
  67.     }
  68.  
« Last Edit: August 06, 2012, 07:39:46 PM by Jeff H »

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: Lets write a complete real world add-in
« Reply #45 on: February 08, 2013, 03:34:45 PM »
I think it would be great to create some libraries that could used to help development. Unless correctly implemented it would waste people’s time and resources and fall flat on its face.
   
Probably the first thing to do is define what it is we would want to accomplish and see if it is feasible then decide if the knowledge and resources are available for accomplishing such a task.
 
I could be completely wrong but I think they did a pretty good job designing the .NET base libraries. So we could learn from their experiences, user studies, etc.. 
 
Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries  looks like good book and from looking through it they seem pretty honest by including examples how they messed and should have done it differently.

Has any more thought been into building something like this?  I would be interested in helping out even though I would consider myself a beginner.  I don't use vanilla autocad that much but work almost exclusively in Autocad MEP and very soon REVIT.  Somethings in Autocad MEP take alot of code just to do the simpliest things.  A reusable framework would work wonders.  I have made an attempt at some things but I know that my code is not that good and could be greatly exanded on.  Having only a few minutes each day to learn the basics does not help.  Anyhow, I would certainly be interested in helping out in anyway if I can.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

bchapman

  • Guest
Re: Lets write a complete real world add-in
« Reply #46 on: February 09, 2013, 09:38:56 PM »
I desperately want an "addin" that will apply text effects... shadows, glow, etc. I've started to look around but I think the only way to do this is somehow interact with windows... too busy learning to rewrite all my old lisps into c# to research it more. 3 done... like 300 more to go lol

I think it would be a great learning experience to create a small useable add-in or little tool as if it were going to the app store.
From beginning to deployment.
 
To make sure it is done for learning experience and not me just trying to get others to create a tool, maybe people could post some suggestions or a vote, but I would stay out of the decision process.
 
 
I know people are busy and have obligations but hopefully we could some people to participate.
 
Hopefully some of you knowledgeable and experienced guys would be willing to throw in suggestions and tips and comments to help keep it steered in a decent direction and keep it from gettin to un-maintable.
 
We could break it up it smaller parts and assign certain parts to people willing to participate.
 
Hopefully some good learning experiences could come from it and show insight on looking at the project at different levels from the big picture down to a expression.
 
Possibly some other useful things could come from it as creating some functions that will test the code on a library of drawings that have many different scenarios locked layer, xrefs attached, different UCS's, different versions, etc...
Using the functionality from commandline vs form or ribbon.
Used in different flavours MEP, Civil, etc......
 
Anyone intrested?