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

0 Members and 1 Guest are viewing this topic.

DaveW

  • Guest
Re: 3d to 2d views engine
« Reply #30 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.
« Last Edit: August 10, 2006, 11:28:24 AM by DaveW »

Maverick®

  • Seagull
  • Posts: 14778
Re: 3d to 2d views engine
« Reply #31 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!

DaveW

  • Guest
Re: 3d to 2d views engine
« Reply #32 on: August 10, 2006, 11:32:43 AM »
Me either, but that sounds like a great trip. I second that, "Have a great time!"

Tramber

  • Guest
Re: 3d to 2d views engine
« Reply #33 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.

Chuck Gabriel

  • Guest
Re: 3d to 2d views engine
« Reply #34 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.

LE

  • Guest
Re: 3d to 2d views engine
« Reply #35 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:
« Last Edit: August 10, 2006, 12:59:01 PM by LE »

LE

  • Guest
Re: 3d to 2d views engine
« Reply #36 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!

LE

  • Guest
Re: 3d to 2d views engine
« Reply #37 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.

LE

  • Guest
Re: 3d to 2d views engine
« Reply #38 on: August 10, 2006, 01:51:10 PM »
Impressive - here is an image showing my simple 3D model - and getting the exterior elevations...

Maverick®

  • Seagull
  • Posts: 14778
Re: 3d to 2d views engine
« Reply #39 on: August 10, 2006, 02:06:02 PM »
Welcome to Softplan   :-D

LE

  • Guest
Re: 3d to 2d views engine
« Reply #40 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  :-)

Maverick®

  • Seagull
  • Posts: 14778
Re: 3d to 2d views engine
« Reply #41 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. 

DaveW

  • Guest
Re: 3d to 2d views engine
« Reply #42 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

« Last Edit: September 12, 2006, 11:46:09 PM by DaveW »

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: 3d to 2d views engine
« Reply #43 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!

« Last Edit: August 10, 2006, 09:53:55 PM by MickD »
"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

LE

  • Guest
Re: 3d to 2d views engine
« Reply #44 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....  :-)