Author Topic: 3d to 2d views engine  (Read 33550 times)

0 Members and 1 Guest are viewing this topic.

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
3d to 2d views engine
« on: August 08, 2006, 11:06:59 PM »
This is a tool I've been developing for a while that creates 2d views from a 3d model composed of 3d solids. It uses the HLR api from the ObjectARX SDK (under utils).
It's mainly at home in steel or mechanical detailing for creating the typical 3rd angle projected views and sections of an assembly or part but it can also be used in the main 3d model to create sections of the model or any type of view with a bit of creative thinking.

It produces two types of linework, visible and hidden which are placed on the layers L-Visible and L-Hidden respectively. These layers can be created before hand (i.e. put in your .dwt file or std drawing) with the users prefered lintypes and colors else it will create them and set them to some default settings.

It produces accurate hidden linework with no overlapping lines and also deletes tangental lines to produce a clean 2d view ready for detailing and annotation.

The commands are -
dcs_2dview  - for creating 3rd angle projection views without clipping, requires user to pick view 'from' and 'to' points for view direction

dcs_2dsection  - for creating 3rd angle projection sections clipped to the depths set by the user while picking the view direction

dcs_2dplan  - for creating a view of the 3d solid in its primary/plan view, projects the linework to the current ucs (normally world) where the object is placed.

The technique for detailing parts is as follows -
1) copy and paste your 3d part or assembly of parts into your detail drawing, ensure it is placed in its final 'primary' of main view with correct rotations etc as required.
2) create your 3rd angle projected views using either the section or view commands, if you need views projected at angles that are not 'ortho'-graphic to your main view, set your ucs to a suitable state and create view (good for endplate projections ;) )
3) create your main view using the plan command, turn of the layers of your solid or delete them and you're done!.

The technique for creating section views in your model -
1) set up your view in the model to 'TOP' and your ucs to world.
2) use dcs_2dsection to pick your views and view depths as asked and pick a pont away off the side of your model to place the created line work.
3) cut/copy and paste or wblock the new linework out to a new drawing and annotate.

This has been tested on my 4 machines I have here and with 2004 and 2006 (not tested on 2005 but should be fine) and works quite well.

You can download the complete zip with instructions and associated files from here -> http://www.dcservices.net.au/MickD/Downloads/

Enjoy!
Cheers,
Mick.

« Last Edit: August 10, 2006, 07:41:40 PM by MickD »
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

Jim Yadon

  • Guest
Re: 3d to 2d views engine
« Reply #1 on: August 09, 2006, 02:01:23 AM »
I'd be happy to give it a go in 2k5.

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #2 on: August 09, 2006, 02:28:14 AM »
Thanks Jim.
It's a very handy and fast tool which I think should be an integral part of acad in some fashion. I know there is solprof and solview but they are far from intuitive .
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #3 on: August 09, 2006, 02:35:56 AM »
Commande: (ARXLOAD "C:/Program Files/Autodesk/Acadm 2004 DX/DCS2dEngine.arx")
C:\Program Files\Autodesk\Acadm 2004 DX\DCS2dEngine.arx ne trouve pas le fichier dll ou autre nécessaire.
; erreur: ARXLOAD a échoué


In English: " it doesn't find the needed dll (?).
error ARXLOAD failed"

As you can see, I even put the ARX in the main program folder.
Do you think it could not work on international versions ?

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #4 on: August 09, 2006, 02:46:53 AM »
oop's it also needs the AsdkHlrApi16.dbx to be loaded first!
I already have it loaded from another app so the error went 'unfound' :)

I found it in -> C:\Program Files\Common Files\Autodesk Shared
on my machine, if you do a 'find' on your install directory it should be there.
I'll update the arx now to load it automatically.

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

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #5 on: August 09, 2006, 03:09:01 AM »
Should be ok now.
Bert, try using APPLOAD instead and browse for the file. I tried ARXLOAD at command line and it said "Unknown Command" ??
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: 3d to 2d views engine
« Reply #6 on: August 09, 2006, 04:39:36 AM »
Ohhhh . . . . this looks/sounds familiar ..
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.

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #7 on: August 09, 2006, 05:04:41 AM »
Yep, this is just an extract of the full version though. I just thought I'd put out for someone to break :)
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

Jim Yadon

  • Guest
Re: 3d to 2d views engine
« Reply #8 on: August 09, 2006, 05:06:21 AM »
You mean there's more to it? Is the whole still in dev or is it a part of something you'd care to share/sell to the rest of us?

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #9 on: August 09, 2006, 05:31:44 AM »
To answer your question directly JAY, this is an offshoot of a much larger project and it's complete in the sense that anyone can use it as is. I may add a 'snap shot' tool to create 3d iso views that project correctly to wcs.

But, there's much more, like 3d sections,  modelling and viewing tools and data and BOM tools for advanced BOM's and material lists in drawings.
If people were interested I would would be willing to sell for a reasonable fee as just to get it to a stage where it would be useful to all (not just my office) would take a fair bit of work and time.

With the 2d view creator I'm about to have it throwing out drawings of assemblies and seperate parts with pre-set views in 2d ready to  insert into drawings and detail. It also stores info in the 2d linework for adding item balloons etc.

I'm currently re-writing my code in arx and will be basing the section creator on the Steel Stubs engine but adding a lot more tools and functionality. Currently Steel Stubs is only useable on 2000/i but I've just about got rid of the MFC and will have it going on the later releases in a day or so.

It will be mostly in C so it will be easy to PInvoke the functions (like drilling and cutting) into .net for automating of user connections.
« Last Edit: August 09, 2006, 05:54:29 AM by MickD »
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #10 on: August 09, 2006, 05:44:33 AM »
I tried ARXLOAD at command line and it said "Unknown Command" ??

've just dragged and dropped.

But never mind !

I did a research with AsdkHlr*.dbx on the entire C volume.
But impossible to find anything, although I got MDT2004, ADT2006 and ADT2007 installed.

I'm sorry MickD but I am not able to try your application  :realmad:

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #11 on: August 09, 2006, 05:50:10 AM »
Now that's strange! can you use SOLPROF ??

or, you can download the zip below and extract it to your acad.exe folder
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: 3d to 2d views engine
« Reply #12 on: August 09, 2006, 06:01:23 AM »
Try the ObjectARX SDK

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.

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #13 on: August 09, 2006, 07:24:45 AM »
Yep, I can use SOLPROF.

Thank you for the file, it works now (don't know why I don't have it ?  :realmad:)

http://xs104.xs.to/xs104/06323/dbx.jpg (my research gives that, if you are curious to see it,  AsdkHlrApi16.dbx is there cause I downloaded it from here).

I've just made a first try and I will tell you why I am so much ENTHUSIASTIC :
I've always hated SOLPROF because it doesn't work with blocks and nested blocks.

It seems like your appli does without problem. Thank you, I go again to see more of it.

 8-)
« Last Edit: August 09, 2006, 07:26:19 AM by Call me Bert' »

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #14 on: August 09, 2006, 07:34:12 AM »
Groovy, this is a hit !

Love it !

Even if I have base point problems with "really nested" entities, but let me use it a little bit and I will publish my sum-up (my conclusions if you prefer).