Author Topic: Need a Routine which insert parametric Components as a assembly  (Read 1535 times)

0 Members and 1 Guest are viewing this topic.

Soui21

  • Guest
Need a Routine which insert parametric Components as a assembly
« on: January 26, 2016, 10:10:08 AM »
Hey Guys,

iīm realy neewbie in the Speech .NET

Im Working with Autocad in my Company. Im searching for a way to define for example 2 Boxes in my Form, and the routine creates automatically a parametric Modell of this 2 boxes and insert it, in my model space. the 2 boxes are "connected" at a specific point, maybe the first upper corner on the left site.

I found here some methods to insert blocks etc. but i didnīt found anything about insert a block which are configured in a form, or insert 2 or more blocks together in a new block, to build your own assembly. Next step is to get drawings from this.

Do you have some tutorials or maybe a link for this "Tool". im realy frustrated.

Thx so far friends.

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Need a Routine which insert parametric Components as a assembly
« Reply #1 on: January 26, 2016, 04:30:35 PM »
Hi Soui21, welcome aboard!

If you need this in a hurry for your company you might be better off getting someone to do this for you for now. This is not a trivial 'starter' project for a beginner coder (you are already talking about parametric's!).
From the information you have provided (and didn't provide) in your request, I'm assuming you are new to AutoCAD programming in general so you will need to learn quite a lot about how AutoCAD works under the hood before you start (this will answer half of your questions).

Here's a link to the help doc's to get you started http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/
It is for AutoCAD2010 but most of it is relevant to get going or you can download the SDK for your version.

Sorry for not being specific to your problem but you need to know this stuff sooner rather than later to be an efficient AutoCAD developer.
It's a long road and you have many hurdles, the first being that you need to learn a .Net language, no small feat in itself.

Perhaps AutoLISP might be an easier learning path? There is much more help available and some of the best lisp guys around are here on this forum and willing to help.
It's an easier language to learn and you will be more productive a lot sooner (that means you will enjoy it sooner!).
There is very little you can't do with lisp that you can in .Net and those things are very technical/specific and rarely used for most customisation work.

Hope that helps,
Mick.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Soui21

  • Guest
Re: Need a Routine which insert parametric Components as a assembly
« Reply #2 on: January 27, 2016, 05:47:41 AM »
Hi MickD,

thx for you Answering. I know that learning .NET language is a long way but i will do it. How long do you think does it take to make a tool as i want for advanced NET Programmer?

is it better to learn C# in AutoCad or is it better to learn C# in visual studio with normal Programs, and after that i switch to Autocad?
My Final Goal where i will come with C# is customizing and automatation of Autocad.

Sorry for my english.
But i understand your words.

Thx so far, i will read more tutorials here in the forum ;)

ChrisCarlson

  • Guest
Re: Need a Routine which insert parametric Components as a assembly
« Reply #3 on: January 27, 2016, 11:46:14 AM »
Hi MickD,

thx for you Answering. I know that learning .NET language is a long way but i will do it. How long do you think does it take to make a tool as i want for advanced NET Programmer?

is it better to learn C# in AutoCad or is it better to learn C# in visual studio with normal Programs, and after that i switch to Autocad?
My Final Goal where i will come with C# is customizing and automatation of Autocad.

Sorry for my english.
But i understand your words.

Thx so far, i will read more tutorials here in the forum ;)

There is no way to determine how long this could take to write. Day, hour, week, month, year are all relative.

In terms of C#/.NET and AutoCAD there are numerous threads on here about that. But in general terms, AutoCAD specific portions of code are relatively small compared to C#/.NET specific. Without a good understanding of the language you will not be able to write an AutoCAD add-on.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Need a Routine which insert parametric Components as a assembly
« Reply #4 on: January 27, 2016, 01:24:30 PM »
Writing the actual code tends to be the easy part, as its the end product not the starting point.  The hard part is working out how it will function - where will data come from?  What user input is required?  Does information need to be stored?  If so, how?  Where?  When?  All of that has to be possible within the limits of what is being worked with (AutoCAD).

It sounds like a lot but lets face it - writing a bunch of code only to find out one of the core principles will never work, resulting in a nearly complete re-write, is something to be avoided like the plague.  Most if not all of those pitfalls can be found before a single line of code is written.  "No plan ever survives contact with the enemy", so the saying goes, so in addition to avoiding the expected problems its also important to be flexible enough to deal with other problems along the way.
If you are going to fly by the seat of your pants, expect friction burns.

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