TheSwamp

CAD Forums => CAD General => The Third Dimension => Topic started by: MickD on August 08, 2006, 11:06:59 PM

Title: 3d to 2d views engine
Post by: MickD 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.

Title: Re: 3d to 2d views engine
Post by: Jim Yadon on August 09, 2006, 02:01:23 AM
I'd be happy to give it a go in 2k5.
Title: Re: 3d to 2d views engine
Post by: MickD 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 .
Title: Re: 3d to 2d views engine
Post by: Tramber 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 ?
Title: Re: 3d to 2d views engine
Post by: MickD 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.
Title: Re: 3d to 2d views engine
Post by: MickD 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" ??
Title: Re: 3d to 2d views engine
Post by: Kerry on August 09, 2006, 04:39:36 AM
Ohhhh . . . . this looks/sounds familiar ..
Title: Re: 3d to 2d views engine
Post by: MickD 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 :)
Title: Re: 3d to 2d views engine
Post by: Jim Yadon 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?
Title: Re: 3d to 2d views engine
Post by: MickD 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.
Title: Re: 3d to 2d views engine
Post by: Tramber 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:
Title: Re: 3d to 2d views engine
Post by: MickD 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
Title: Re: 3d to 2d views engine
Post by: Kerry on August 09, 2006, 06:01:23 AM
Try the ObjectARX SDK

Title: Re: 3d to 2d views engine
Post by: Tramber 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-)
Title: Re: 3d to 2d views engine
Post by: Tramber 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).
Title: Re: 3d to 2d views engine
Post by: MickD on August 09, 2006, 07:39:06 AM
Glad you got it working Bert, good stuff!

It will work on any 3d solid, nested or not. I have also had it working on normal entities such as lines, blocks etc. I will add that in also when I get time (think 'FLATTEN').
Title: Re: 3d to 2d views engine
Post by: Tramber on August 09, 2006, 08:08:12 AM
I'll give a DWG that I'm using for testing
Title: Re: 3d to 2d views engine
Post by: Tramber on August 09, 2006, 08:13:14 AM
This is the entire block I rendered with Penguin :



The problem is that the wood steps are spread and some other projections appear far from the base point.

Here is the file :
Title: Re: 3d to 2d views engine
Post by: Tramber on August 09, 2006, 08:30:02 AM
Anotehr attempt

In red, some entities appear at a different X, so I put them in red and moved them to stick again to the yellow ones (there was a gap on X axe of about 13740mm, my current unit is the millimeter).

What we can see is that those 2 groups are composed of the same objects (floor goes with the metal support parts) than in the previous exemple where I had the same gap.

But don't worry, it still is very impressive.
Title: Re: 3d to 2d views engine
Post by: Tramber on August 09, 2006, 09:02:30 AM
Hello, it's me again, the  :lol:  beta-tester !

If I explose one by one any of the block entities, and the sub ones, then it works better.

My 2 groups seem to obey to 2 different basepoint families. It is strange....
Title: Re: 3d to 2d views engine
Post by: deegeecees on August 09, 2006, 10:25:31 AM
WOW! What a matrix nightmare this must have been! Just what I needed for the job at hand here. Trying it out, will post if problems arise.

This is one of the reasons I never stray too far from the puddle.
Title: Re: 3d to 2d views engine
Post by: MickD on August 09, 2006, 05:55:23 PM
Nice one Bert, it shouldn't(?) matter I wouldn't think, it takes each part one by one and calc's and projects the hidden lines to world, I've never tested it on nested blocks though. Also be careful when picking your 2 points for the view direction, make sure you use polar/ortho as it will take your view direction literally and may produce odd results, most projected views are orthographic so this should ensure good results

dgc's, it wasn't too bad once I worked out what was happening. ARX has some excellent tools for geometry manipulation.

I'll give you guys another tip, if you store xdata with the application name "DCS_3D" you will have access to this data in the new linework (hidden or visible) for 'each individual part'. This is pretty cool and handy for item balloons etc. when detailing ;)

You can test this by using express tools to add and read the xdata. Add xdata to the solid, produce the 2d drg and check the xdata, it will still be attached, now that took some working out :)
Title: Re: 3d to 2d views engine
Post by: DaveW on August 10, 2006, 01:09:08 AM
Getting nothing with the Command: dcs_2dplan

Select objects:
Hlr returned 1806 curves

Very interesting idea Mick. I went a different route. I have automated dview down to 2 choices and one click. All orthographical though. I have second version of it for dealing with sections, when you do not want features beyond in the original solids to bleed through from that hollow effect the dview gives you. So it runs dview as the first code, but also runs the section command and generates regions through the 3D solids. I move it a hair closer to the camera so that the region is not exactly on the clipping plane, otherwise it's a 50/50 toss up of bleed through. It is strictly a paperspace utility though. Each and every time the second code is run I generate a new layer called section 1, section 2, etc. Then freeze that section in every viewport in every layout, except for the viewport the user is working in. I attach every field of xdata I have to the regions too, 18 in all I believe, lol. If I had your skills I would have taken a different route. It seems to work pretty good, but it will only generate the dview / with section planes through 3d solids. I may be able to get to deal with solids nested in blocks, but I have not bothered with the one yet. Great work man. I am very impressed. There are quite a few possibilities with what you have created.
Title: Re: 3d to 2d views engine
Post by: MickD on August 10, 2006, 02:09:52 AM
Thanks Dave.
What I have there uses virtual viewports with clipping planes set by the picking points (for sections). I will be setting up auto ortho views for my own stuff but this is a simple tool that anyone can get good results with and can be used in any number of ways.
What it does essentially is it grabs all the edges from the solids (it can be made to use 2d lines and cirles too), creates planes of each edge that are perp to the camera and a plane for each clip and splits the edges at each plne intersection. Then it's a matter of  working out whats behind what and projecting the linework left to the final plane.
Quote
Getting nothing with the Command: dcs_2dplan

Select objects:
Hlr returned 1806 curves
are you sure? make sure you delete/hide or turn off the solids layers, it projects the linework directly below the solid (or onto the current ucs plane but I'd have to check).

Quote
If I had your skills I would have taken a different route. It seems to work pretty good, but it will only generate the dview / with section planes through 3d solids.

I'd be very interested in your thoughts/ideas Dave, this is still very extendable. :)
I don't get what you mean by genarating the dview... though??(no dview used in code) The 2dview will generate all linework for for all objects selected to any depth as clip planes are not set, the 2dsection will only generate linework between the 2 picked points (p1 = near plane, p2 = far plane) I had thought of taking a slice through to add hatch to but I just haven't got there yet :)

Thanks for the feedback,
Mick.
Title: Re: 3d to 2d views engine
Post by: Tramber on August 10, 2006, 03:44:51 AM
still have problems when blocks are configured with different base points but one thing I can tell is that your appli is something I ever expected.
I've been trying it on other projects and it is impressive.

I didn't understand what is the manipulation with Xdata, so sorry but do you mean that your appli sticks informations to the solids that had been selected ? I'm lost.
Title: Re: 3d to 2d views engine
Post by: Kerry on August 10, 2006, 04:06:21 AM
Bert.
You can put XData on the Solids and the appliation will transfer the same XData to the lineWork. .. really nifty :-)
Title: Re: 3d to 2d views engine
Post by: MickD on August 10, 2006, 04:12:38 AM
I've never used 3d solids in blocks before, groups are ideal though as you can group assemblies and still change things without too much trouble. They don't hold together with cut and paste though but I have tools to make this a lot easier.

Bert, you can add some xdata, say a part number, to the 3d solid and when you convert it to a 2d drawing the information (xdata) is still attached to each individual line generated that was related to the original solid.
You can then query the new lines for xdata and it will be attached. This is very handy!

You can try it by using the express tools to add and get xdata. When requested for appname, use "DCS_3D" as that's the only app name it works with at the moment.
Title: Re: 3d to 2d views engine
Post by: Tramber on August 10, 2006, 05:24:41 AM
Understood  ^-^

I'm ready if you want to make it a shareware.
Depending on the price, if not too much expensive, I could offer to introduce it on a french forum where I am very (very) active.
Title: Re: 3d to 2d views engine
Post by: MickD on August 10, 2006, 05:48:46 AM
Thanks Bert, will do. I'd like to add some tut's to get people going quickly. This module would be free but I guess I could put a 'readme' in the download with some info on other stuff in the works that will be available for a very reasonable price, I don't plan on getting rich from this but a few dollars for beer or two would be nice :)
I'm glad you like it Bert, thanks for the feedback.
Title: Re: 3d to 2d views engine
Post by: Tramber on August 10, 2006, 06:07:46 AM
I'm glad you like it Bert, thanks for the feedback.

Anyone who use blocks, 3D and SOLPROF know what I mean.
Using DXB or copy-paste DWF or any other annoying technic is a nightmare.

I'm leaving my home (Strasbourg, France) tomorrow for 2 weeks of holidays with my girlfriend, my little Mercedes and 2 bikes for a little trip to Netherlands, Germany, Danemark (ever dreamed to see LEGOLAND and its museum !) and probably Sweden (Europe is a little place).

So I'm not able to test more but it is planned..... for sure. I have daily 3D presentations to make.
Title: Re: 3d to 2d views engine
Post by: DaveW on August 10, 2006, 11:00:50 AM
Hey Mick,

You are right, dcs_2dplan does work. Sorry for the bad info.

My code for sections works like this:
http://SmartLister.com/files/section.avi
No audio, 8 meg.

You mentioned hatching. :) That is why I automate the section command "with" my automated dview code. Section produces regions. They are always closed and dependable to hatch. I have not added the hatching code yet either. I am getting it done. Just not as elegant and professional as you.



In some ways I have no issue with blocks. Because I am using dview with clipping planes ACAD puts everything there I need. The only time blocks are an issue is if I want to run the section command too.
The views generated are dview with only the front clipping plane turned on. If they do not want the beyond entities that can always add a back clipping plane in their viewport later. No one ever does this in the cabinet field though. However, I think I am going to have to do that on the project I am working on now. I am creating a new type of wall for buildings and I am going to want to automate a single wall in view, without seeing the walls beyond. I really like the way my code runs because it does not generate any additional entities in ACAD, unless they run the section command with it. When they change the model the view updates automatically, except for the section regions ones. But you do not need to use that particular utility all the time. It is only when there is bleed through of features beyond inside the solids.

You may notice in the video that I create a viewport too. This creates the layer for the viewport, "vports", sets the color, and then after they pick the points for the viewport it sets the viewport to hide on plot and clears dviews clipping planes. I do this because once you create a view in a viewport with dview and set clipping planes, afterwards, for weird reason, when you create a new viewport ACAD puts your previous clipping plane settings in the new viewport. You have to run dview at the command line and clear the clipping planes to see properly in the new viewport, so I just run it for them when I create the new viewport. Hell man, much of the this code is sendcommand. I am surprised it works as well as it does, but soon I need to automatically dimension everything. I hope it does not fall apart or become overloaded at that point.
Title: Re: 3d to 2d views engine
Post by: Maverick® on August 10, 2006, 11:26:44 AM
I'm leaving my home (Strasbourg, France) tomorrow for 2 weeks of holidays with my girlfriend, my little Mercedes and 2 bikes for a little trip to Netherlands, Germany, Danemark (ever dreamed to see LEGOLAND and its museum !) and probably Sweden (Europe is a little place).

Don't wanna hijack but..... this sounds awesome. (not so much Legoland but the rest.  :-)) Have a great time!
Title: Re: 3d to 2d views engine
Post by: DaveW on August 10, 2006, 11:32:43 AM
Me either, but that sounds like a great trip. I second that, "Have a great time!"
Title: Re: 3d to 2d views engine
Post by: Tramber on August 10, 2006, 11:46:50 AM
Hey guys, it is only 2500 kms, maybe 1700 miles in 10 days.

You people live in a too big country !

I could visit 5 languages and culture (even more if I want to) in less than 500 kms if I wanted to.

Sorry that you don't like LEGO Maverick. Of course, I'm interested in the museum, not the leasure park.
Title: Re: 3d to 2d views engine
Post by: Chuck Gabriel on August 10, 2006, 11:52:27 AM
Holy Cat Hair Mick!  You've been busy!  It is very generous of you to share it with all of us, especially considering the time investment it must represent.
Title: Re: 3d to 2d views engine
Post by: LE on August 10, 2006, 11:54:13 AM
Mick;

I need to try your software, in this weekend - I do not do any 3D stuff, but it sound to be a good application - what else can we expect from a master like you.

 :lol:
Title: Re: 3d to 2d views engine
Post by: LE on August 10, 2006, 01:19:19 PM
Well Mick;

I just got a chance right now.... to ran some tests - Very good! - I need to draw a model with slope roofs, and see how is coming that up.... so far pretty nice..... (I did a very similar routine - but just for plain 2D objects, to get interior/exterior elevations and sections - but you are using a 3D objects.... man)

Thanks!
Title: Re: 3d to 2d views engine
Post by: LE on August 10, 2006, 01:33:34 PM
More WOW - I added to my 3D model, some door and window openings - and man it draws the elevations with them....  :-o

Rock and Roll.
Title: Re: 3d to 2d views engine
Post by: LE on August 10, 2006, 01:51:10 PM
Impressive - here is an image showing my simple 3D model - and getting the exterior elevations...
Title: Re: 3d to 2d views engine
Post by: Maverick® on August 10, 2006, 02:06:02 PM
Welcome to Softplan   :-D
Title: Re: 3d to 2d views engine
Post by: LE on August 10, 2006, 02:13:59 PM
Welcome to Softplan   :-D

Yep - it can be as they might be to many, etc, etc.... but doing the engine, that's what it counts here - at least for me  :-)
Title: Re: 3d to 2d views engine
Post by: Maverick® on August 10, 2006, 02:18:30 PM
  I totally agree.  It's very impressive to be able to code this.  I wouldn't know where to start.

  I was just poking fun. 
Title: Re: 3d to 2d views engine
Post by: DaveW on August 10, 2006, 05:04:03 PM
I see the viewpoint toolbar there LE, you may want to throw this in a text file call it viewpoint.lsp.

Code: [Select]
;smd
(defun c:1() (command "-VIEW" "TOP"))
(princ)
(defun c:2() (command "-VIEW" "FRONT"))
(princ)
(defun c:3() (command "-VIEW" "LEFT"))
(princ)
(defun c:4() (command "-VIEW" "RIGHT"))
(princ)
(defun c:5() (command "-VIEW" "NWISO"))
(princ)
(defun c:6() (command "-VIEW" "NEISO"))
(princ)
(defun c:7() (command "-VIEW" "SWISO"))
(princ)
(defun c:8() (command "-VIEW" "SEISO"))
(princ)
(defun c:9() (command "-VIEW" "BACK"))
(princ)
(defun c:0() (command "-VIEW" "BOTTOM"))
(princ)
;/smd

Title: Re: 3d to 2d views engine
Post by: MickD on August 10, 2006, 06:00:39 PM
Awesome, thanks Guys.
Dave, glad it was working correctly, you had me worried for a bit :D
How does your code go on large models Dave or is that not really an issue, my code may take a few sec's on larger models (8 meg say) but it's pretty quick really, as quick as acad can do it anyway :)

Thanks Chuck, that's just the start. I have it producing blocks of the views in C# (I ported an interface to this), just about to  port it to arx and it will include using pre-saved named views which will take the dimensions and any other annotation with it. This way with a bit of layer management you can do all your annotation right there in the model, take a snap shot, insert it into a drawing and your done with the latest accurate info. If you need an update, delete the old block, create a new one and insert it - done!

Title: Re: 3d to 2d views engine
Post by: LE on August 10, 2006, 07:05:11 PM
I see the viewpoint toolbar there LE, you may want to throw this in a text file call it viewpoint.lsp.

Code: [Select]
;smd
(defun c:1() (command "-VIEW" "TOP"))
(princ)
(defun c:2() (command "-VIEW" "FRONT"))
(princ)
(defun c:3() (command "-VIEW" "LEFT"))
(princ)
(defun c:4() (command "-VIEW" "RIGHT"))
(princ)
(defun c:5() (command "-VIEW" "NWISO"))
(princ)
(defun c:6() (command "-VIEW" "NEISO"))
(princ)
(defun c:7() (command "-VIEW" "SWISO"))
(princ)
(defun c:8() (command "-VIEW" "SEISO"))
(princ)
(defun c:9() (command "-VIEW" "BACK"))
(princ)
(defun c:0() (command "-VIEW" "BOTTOM"))
(princ)
;/smd

Thank you Dave;

I am still doing 2D work....  :-)
Title: Re: 3d to 2d views engine
Post by: Jim Yadon on August 10, 2006, 09:07:03 PM
Wow! I hadn't a chance to give this thing a whirl yet. I've been up since 3am EST this morning with Training prep, job duties and a head long 4 hour truck through the muck with some sophmore CAD Jockies so I'll have to beg off 'til saturday to try it out. What the others have drawn up and used it with looks great though!

DaveW, did you try it on any Architectural Millwork models yet? What did you think of the results there?
Title: Re: 3d to 2d views engine
Post by: DaveW on August 10, 2006, 09:42:19 PM
Mick's code works great. It is a different way of doing things that has other uses then what I need currently, but others need it real bad.

Mick,
Not an issue. It is just the weight of viewport in the dwg, that is all. They do add up though.
Title: Re: 3d to 2d views engine
Post by: Tom on August 10, 2006, 11:52:58 PM
Hi Mick
Just ran a test on a 8.5 meg dwg with 500 solids in it worked out verry good
Then ran it on a 22 meg dwg with about 1200 solids and it crashed me out
Title: Re: 3d to 2d views engine
Post by: MickD on August 11, 2006, 12:34:26 AM
Thanks Tom,
I still need to put a lot of work into it to make it a safe, robust and flexible tool. I guess that's why it's free :)
Serously though, the only 'safe' way to handle that may result in the engine not processing the complete model and I'm looking into it as we speak. I may be able to make it so it only misses a few lines here and there and continues  but beyong the scope of my function it's in the hands of AutoCAD and the memory gods as there's a LOT of curves being accessed, split, processed for visibilty and added to the drawing database all at once!

I've also just added a 'snap shot' tool that takes a snap shot of any current view and projects it to world, very cool, but I have some linework placement code to fine tune before putting it into production. This is good for iso views and such for that wow factor :).
Title: Re: 3d to 2d views engine
Post by: MP on August 11, 2006, 12:38:30 AM
Hey Mick just a quick note. We do TONS of 3D modelling, oil / gas production facilities etc. I plan to put your utility thru some tests on some of our models; just haven't had time. Perhaps next week. Tangent: I/We had repeatedly asked Autodesk for hires / intelligent hidden line removal utilities in the past ; even asked them to expose the core HLR algorythm to lispers; meh. Anyway, thanks again, looking forward to trying it out. Eeek, starting the zopiclone babble, out-a-here.
Title: Re: 3d to 2d views engine
Post by: MickD on August 18, 2006, 12:55:02 AM
Have you had a chance to have a look yet Michael, I'd be interested in your feedback.

Here's some pic's of what I'm working on at the moment, a 'snap shot' tool. It takes an piccy of your 3d parts from the current view, you can use 3d orbit or what ever, and it takes a snap shot and projects it to world for those nice looking iso views in your details. It still needs some work on the placement of the projected lines but it works quite well.
The first one is taken from the actual view (the 2d line work looks distorted) and the second is from 'top' or world plan, standard for 2d.
Title: Re: 3d to 2d views engine
Post by: Tramber on August 21, 2006, 11:26:16 AM
Back from my little trip around northern Europe !

MickD, I still have problems within nested blocks. I'm able to recognize the exact gaps that there are between the basepoints of the blocks.

Would you like we go on the feedback ?
Title: Re: 3d to 2d views engine
Post by: DaveW on August 21, 2006, 02:13:13 PM
Hey Mick,

Can your utility be made to accept entities as seen in a paperspace viewport?

The reason I ask is that if somone wants to send out a 2D dwg with my software, they are required to have the 3D model in modelspace. Your utility may reduce the file size and allow the removal of the propritary 3D model too.
Title: Re: 3d to 2d views engine
Post by: MickD on August 21, 2006, 06:27:30 PM
I can't see why not Dave, In fact the way I have it configured I use saved views complete with clip planes set for sections or elevations and I can iterate through them to throw separate drawings of each view to be placed into the final drawings so it should only be a small step to vports.
I can see the advantage in your case though as you can have your annotation done in PS ready to go, in our case we need to pull the model apart more so exporting the details is easier for us. Other model sections are detail in the model and views are generated and simply placed into drawings as a finished item, helps for updates too to keep the model and details sinc'ed.
There could be some small issues with the final projection in the case of iso views but plans and sections would not be a trouble. Deleting the solids can be done on the fly, in fact that was what I did originally. I used to copy the solids into another drawing to be converted and the engine deleted the solids on the way.

'Bert welcome back, hope you had a good trip!
I really know very little about blocks as I have had very little use for them other than section symbols etc. I've always used groups which I find much more flexible. Is there any particular reason to use blocks instead of groups?, blocks could involve quite a lot of work to get it right.
Bert, you can send your friends here -> http://dcservices.net.au/MickD/article.php?story=2006081108254180
and I also have a list of what's in development here -> http://dcservices.net.au/MickD/article.php?story=20060811101758905
Title: Re: 3d to 2d views engine
Post by: Bryco on August 22, 2006, 12:42:27 AM
Mick, I love blocks and use them all the time but they are nasty to work with. The simplest way may well be to explode all the blocks and delete them when you export the drawing. It worked for me to solprof objects as you cant solprof a block, I run a little routine that explodes all the blocks (including nested) then deletes everything that isnt a solid. Now there is no translation problems.
Title: Re: 3d to 2d views engine
Post by: MickD on August 22, 2006, 01:08:35 AM
hmm, I may leave that for an exercise for the user, that way they can do a final check before continuing perhaps?
The main problem would be with nested blocks but I guess it wouldn't be too hard to implement.
Title: Re: 3d to 2d views engine
Post by: Tramber on August 22, 2006, 03:00:08 AM
To answer about the use of blocks :

Groups are nice but they show all the grips of the elements and they don't allow to save weight. If you multiply blocks insertions (several insertions of one block), you just don't make the size of the file much increasing and that's the advantage number 1.
Advantage number 2 ; blocks are easy to programm, and even more to update. This is why I use them a lot.

Of course, nested and "sub"nested blocks make the exercice difficult.

I'm currently working on a new exemple I'll join soon. I allow myself to think that it will work perfectly soon.
Title: Re: 3d to 2d views engine
Post by: Tramber on September 14, 2006, 11:31:40 AM
Feedbacking is not over !

I run the ARX almost everyday, even if it becomes a bit boring to all sub-explose due to the basepoints variations.

There is a bug if I type pt1 = 0,0,1000 pt2= 0,0, then it crashes at pt3.
This is the first time I use this routine from top to down.
Maybe this doesn't work in the case we do a "plane view" VIEW !

Don't worry, it is not too bad  8-)
Title: Re: 3d to 2d views engine
Post by: Tramber on December 14, 2006, 02:32:06 PM
Dear Mick,

I've been talking about your program to my friends on the french forum I'm used to going. I suggested them to download and try the ARX. We developped so many topics on SOLDRAW...

It is a plebiscite. Some think that it'is great to use your routine 'cause it works on blocks, on surfaces. Some keep on thinking that the SOLDRAW family functions are better because it is easy to reset the views by cliking the windows and redraw (SOLDRAW) and it remains a ream paper space utility.

An other point is that it appears to be practical to some people to obtain as many layers as they drew views.

One thing is sure : there are, at least, several people in my country using it now almost daily. For some reasons, they can't read and write English and they don't come here to express their happiness  :-)
Title: Re: 3d to 2d views engine
Post by: MickD on December 14, 2006, 03:00:20 PM
Thanks for the feedback Bert, good to see it's going to good use :)
At it's current stage of development it is more of a proof of conception application. Now I know it works (and how to configure it for different purposes) the gates are open to many possibilities. Things such as automatic projected views and sections and a 1 to 1 relationship back to the model for updates with a click of a button.
Note that I've also put a quick demo up on the download site showing a basic way to use it. -> http://www.dcservices.net.au/MickD/Downloads/

Cheers,
Mick.
Title: Re: 3d to 2d views engine
Post by: Tramber on December 14, 2006, 04:10:43 PM
Yes, you already told us about that. I mean the update potential possibilities and I applause.
The idea of producing automatic orthogonal (I suppose) views and sections is good.

By the way, did you know this (I've been told recently and I hadn't paied attention to it) : in US (and UK ?) , the left views are traditionnaly put on the rigtht and they are put on the left (unless it is the opposite  ^-^) in latin countries such as France ?
Title: Re: 3d to 2d views engine
Post by: Rob_Kish on December 18, 2006, 08:38:04 PM
I believe Bert's post is describing Third-Angle projection (common, or standard, in US and in UK) and First-Angle projection (common, or standard in Europe and Asia). See wikipedia description of each (http://en.wikipedia.org/wiki/First_angle_projection).
Title: Re: 3d to 2d views engine
Post by: Tramber on December 21, 2006, 03:00:56 PM
'Xactly  8-)

Now, my question is : when will you draw in meters  :lmao:, just kidding  :kewl:
Title: Re: 3d to 2d views engine
Post by: Rob_Kish on December 31, 2006, 08:51:10 PM
The answer: when supplies are available in metric unit modules ... or when mandated by code or contract.
Title: Re: 3d to 2d views engine
Post by: Bob on January 04, 2007, 12:57:55 PM
The worst thing to find on a drawing is a combination of first and third angle on the same sheet.

Like the plan of the object drawn above it above when the left hand view is drawn on the right (if you know what I mean).
Title: Re: 3d to 2d views engine
Post by: Tramber on March 19, 2007, 05:43:33 AM
Mick !

The download link doesn't work anymore :::

Did you decide to discontinue its availabilty ?
Title: Re: 3d to 2d views engine
Post by: MickD on March 19, 2007, 04:34:10 PM
Hi Bert, sorry 'bout that, my site was getting spammed so I had to close it down. I'll put the zip back at the first post for those that want to use it, probably later today.
Cheers,
Mick.
Title: Re: 3d to 2d views engine
Post by: Chuck Gabriel on March 19, 2007, 05:15:31 PM
Sorry to hear about your web site troubles Mick.  I hope you've been well otherwise.
Title: Re: 3d to 2d views engine
Post by: MickD on March 19, 2007, 05:32:33 PM
Thanks Chuck, I've been well thanks.
Not that it was much of a site, but it is annoying that these guys with their 'bot's think it's ok to post stuff to your site which is obviously not wanted. I probably could have fixed it but I have bigger fish to fry at the moment.
I might even 'organise' the source a bit (it's pretty messy  :roll: ) , add some comments and post it in show your stuff when I get time, should be ok for acad 2000-6 at least, not sure about 2007.
Title: Re: 3d to 2d views engine
Post by: Tramber on March 20, 2007, 05:06:58 AM
Cool...

The fact is that I gave the link in a european forum. Recently, some people tried a download that didn't work out. I shall tell them that it is for soon.

PS : as I already told you, I use the routine everyday  :wink:
Title: Re: 3d to 2d views engine
Post by: MickD on January 17, 2008, 10:16:01 PM
Ok, it's been a while since I have worked with this one and the worst part is I lost my final code with a hd break down (I could have sworn I had a back up on CD but couldn't find it?!, Sorry for the wait Andy).

Attached is the version for 2k7/8, only in beta so any feedback would be great.

If anyone would like a 2004-6 version I could arrange something next week, if anyone has the very latest 2006 version in zip file with instructions could you please post a copy for others, thanks.

I'll attach them back at the first post as well.

Commands are:

DCS2DPLAN - creates a plan view of the objects and projects them to the plane of the ucs
DCS2dVIEW - creates a view of the objects given 2 points to determine view direction and puts them on wcs where you pick
DCS2DCLIP - as above only the view/objects will be clipped to the distance given by the 2 picked points.

A few notes:
If you want to have the output come out properly you will need to create 2 layers named L-HIDDEN and L-VISIBLE with their respective line types and colours set to suit.
At present there is no filtering for 3d solids only so it will take lines, circles etc through the engine and project them to the plane (like flatten), this may be handy for certain situations such as taking grid lines or text etc into the produced view. I may create a version that filters for solids and normal ents and puts the normal ents on their original layers.
Passing of xdata to output is not available yet either but won't be too far away.

EDIT: remove file, see posts below.
Title: Re: 3d to 2d views engine
Post by: Tom on January 17, 2008, 10:34:27 PM
Hi Mick
Thanks for this I have just downloaded it and when I load I get this message
DCS2dEngine2k7.arx cannot find a dll or other file that it needs.
Title: Re: 3d to 2d views engine
Post by: MickD on January 17, 2008, 10:47:00 PM
Ahh, ok. You will need to load the adesk hlrapi dbx. If you run solprof (even if you cancel out) it should load the dll then you should be right. If that doesn't work, you will need to load the attached first as well. Once I get it sorted I'll package it up a bit better.
Thanks Tom.

EDIT: removed file, see post below
Title: Re: 3d to 2d views engine
Post by: MickD on January 17, 2008, 11:02:37 PM
Try this, I've removed the other links above.

just load the dcs*.arx and it will load it's dependencies itself, the little things you take for granted :)
Title: Re: 3d to 2d views engine
Post by: MickD on January 30, 2008, 07:26:23 PM
Just a quick note.

In previous versions I had a 'snapshot' (flatshot in 2007/8) command that took created a 2d image of your current view. This isn't implemented in this release but if you want to create iso images etc. set up your desired view, set ucs to 'view' and use the plan view command.
It will just project the image to world in some place but it can be moved using layer filters or ssx or similar.
Next version with have a block/group creating option so the views are easier to move or grab.
Title: Re: 3d to 2d views engine
Post by: Kerry on January 30, 2008, 09:18:16 PM

Great to see it coming along well again Mick !
Title: Re: 3d to 2d views engine
Post by: MickD on January 30, 2008, 09:25:15 PM

Great to see it coming along well again Mick !
Thanks Kerry, yes it is, I had to start from scratch but it's a lot better written this time (ie. safer and faster), things are 'clicking' fast so I better stay at it while the going's good :).

I will have a swag of 3d modeling tools coming out soon as well, stay tuned.
Title: Re: 3d to 2d views engine
Post by: MP on January 30, 2008, 09:26:22 PM
KOOL!
Title: Re: 3d to 2d views engine
Post by: bikelink on June 23, 2010, 11:06:12 AM
I wrote a simple code that perform the projections of a solid in c#.
the result is very similar. the actual limit now it's understand what are the hidden lines.
i haven't time now to wrap the "Hlr Library" in c# but i think we can obtain a nice solution joining the c# and hrlapi
Title: Re: 3d to 2d views engine
Post by: MickD on June 23, 2010, 06:44:46 PM
I've written a little wrapper to get some functionality from the hlr api but ideally it would need a fully blown wrapper to get the most out of it, my wrapper is more focused on what I need rather that exposing all it's functionality.
I'll find the code and post it if anyone's interested.
Mick.
Title: Re: 3d to 2d views engine
Post by: bikelink on June 24, 2010, 06:20:39 AM
if You can post it we can  share it here and update it.  ;-)
Title: Re: 3d to 2d views engine
Post by: MickD on June 24, 2010, 06:37:54 PM
No prob's, I'll dig up the code and post when I get some spare time.
Title: Re: 3d to 2d views engine
Post by: bikelink on June 29, 2010, 12:27:14 PM
ok...while i'm waiting ...'cause  i'm eager to obtain my drawing
that's my result and i'm very happy...  I Wrote in c++ and then wrapped with a class in c#
(http://i46.tinypic.com/k98i6t.jpg)
Now I have a complete projections  (i can set colors, layers, lineid ecc..)   and of course.. my little lib ;)
Title: Re: 3d to 2d views engine
Post by: MickD on June 29, 2010, 04:52:17 PM
Nice work!
The tricky bit is the transformations to put the views where you want them. I'll have some time later today and I'll post my wrapper code, cheers.
Title: Re: 3d to 2d views engine
Post by: Jeff Benson on May 05, 2011, 06:34:50 AM
Good Work ,
i will also prepare my code and share it here

http://dashquid.com (http://dashquid.com)
http://fatlossprofessional.co.uk (http://fatlossprofessional.co.uk)
http://fatlossprofessional.co.uk/how-to-lose-weight-fast/ (http://fatlossprofessional.co.uk/how-to-lose-weight-fast/)
http://mobilehelper.co.uk (http://mobilehelper.co.uk)
http://securetrip.co.uk (http://securetrip.co.uk)
http://whichpetcover.com (http://whichpetcover.com)
http://youtube.com (http://youtube.com)
http://wikipedia.org (http://wikipedia.org)
http://twitter.com (http://twitter.com)
http://amazon.com (http://amazon.com)