Sunday, 29 January 2012

Complex Grading Boundary

I have been experimenting on trying to find a quick way to make a boundary around a complex assortment of grading and featurelines as shown below.

ryvu0npk

Basically the quickest way I have come up with to date is too.

  1. Select all featurelines in the drawing (using my SF command in a lsp)
  2. Isolate all the featureline
  3. Hide all the internal featurelines
  4. Close of the perimeter with temporary polyline as shown in white above
  5. Use the Lineworkshrinkwarp command to generate the boundary around the perimeter.

Better yet It would be good if Autodesk could make the interactive corridor boundary tool work with featurelines and polylines objects outside of a corridor to generate a boundary.

Thursday, 26 January 2012

Another couple of good AU papers on Grading by David Garrigues

The reason I was looking at waybackmachine the other day was to track down the code that David Garrigues demoed in his 2008 AU paper for doing temporary work planes surface. Could not download it from the archived community site.

But found an AU site with the 2008 papers. You can download the code and video presentation which are worth a watch for those doing grading. The paper does not download for some reason.

http://test42.dcheetah.com/?nd=class&session_id=2921

Also David’s presentation from 2010 is very good

http://au.autodesk.com/?nd=class&session_id=7215

Just have to upgrade the grading code to vb.net for 2012 unless some else has and wishes to share it.

Wednesday, 25 January 2012

The WayBackMachine

Sometimes websites get taken down for what ever reason and you wish you had a time machine.

Well check out the Waybackmachine remember the old Autodesk Civil Engineering Community site

http://web.archive.org/web/20080412100024/http://civilcommunity.autodesk.com/

and some of the old utilities

http://web.archive.org/web/20081222202015/http://civilcommunity.autodesk.com/content/utilities/

or Tony Tanzillo’s website

http://wayback.archive.org/web/*/http://caddzone.com

http://wayback.archive.org/web/*/http://autodesk.com

Monday, 23 January 2012

Adding Scale and other Fields to Title Block

Been updating the old title block to be a bit more automatic to save sometime I insert fields into the block attributes to give me the data I wanted as follows

Insert Copyright Year
utcriayx

Insert Drawing Name 
vjqzfwvy

Inserting blanks as per link

Inserted Drawing Scale as per this video

jsvky5f3

Updated the scale bar values to update based on the scale as well

qoegg55w

 

I did look at using a diesel expression first for the scale calculation but this did not work as the object ID is turned to a number straight away and the link to the viewport is broken here are some links on diesel for future reference anyway

http://civil3d.wordpress.com/2011/08/23/quick-to-the-diesel/

http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS73099cc142f4875513fb5cd10c4aa30d6b-7b3c.htm,topicNumber=d0e393837

http://www.cadforum.cz/cadforum_en/qaID.asp?tip=3676

Sunday, 22 January 2012

Developer Centre VB.net tutorials

Seeing I am going off on a bit of a tangent on programming at the moment, it occurred to me that a lot of people may of not seen the Developer Centre resources for .net that include a number of labs that are design to get you started in using .net with Autocad. They are available here for those that are interested. 

Saturday, 21 January 2012

Writing Object Orientated VB.net Code for Civil3D (Part 2)

Over the last 12 months I have come to the conclusion that in going from VBA to VB.net you need to start employing some software architecture and Object Orientated Programming (OOP) techniques to progress your coding projects past small routines to the next level with larger numbers of classes and greater complexity.
So over the the last few months instead of writing more code I have been investigating how to write better code. To clarify my thoughts I typically write things down so plan to do this as a number of blog postings, being self taught of course the way I think about thinks my not be strictly correct or just plain wrong. So feel free to post a constructive comments explaining things more correctly, or differently.
Now having investigated the subject I bit I have come to the conclusion that there are two ways to write code either from the bottom up or the top down.
Bottom Up MethodThis is amateur method that I have been using for a while, I have an immediate problem, know now to open the new VB.net IDE and type some traditional VB language, so can piece together some sort of working code routine.
Top Down MethodThis (i guess more professional) method works by mapping out how your code will work using Unified Modelling Language (UML) Case and Class diagrams. You could do this before starting any code and depending on what UML package you use you can generate the outline of your code automatically.
So before we can start Refractoring any code we need to understand what a Class is and what UML Case and Class diagrams are to plan our attack.
What is a Class?
From the MSDN website
“A class is simply a template of a type of object; think of it as a blueprint that describes the object. Just as a single blueprint (aka Class) can be used to build multiple buildings (aka objects), a class can be used to create multiple copies of an object.”
So what does this mean in plain English and how do we write I class in VB.net? There are a number of videos on the internet explaining classes and how they are written but these two are quite good.

VB.NET Working With Classes: OOP, Object creation and structures (1)VB.NET Working With Classes: OOP, Object creation and structures (2)

After watching the videos hopefully you have an understand what a basic class is and the power of VB.Net intellisense, its icons and drop downs in helping you write code.
One thing I have struggled with is remembering what all the little icons mean. To refresh myself I have pasted together below some screen shots off the internet to refer too.
intellisense Icons 2
What are UML Case and Class Diagrams?UML Diagrams are basically a standardised way to document the structure of your code. I have found a couple of introductory video’s on UML using the program Software Ideas Modeller, here and here by Mike Lively, he also has created a series of UML Reference Cards.
If you work through the example given by Mike you can generate the outline of the VB.net code automatically by going to the Tools menu Generate Source Code.

Below is a screen capture of the vb.net code generated.
ohjnrwts

Notes:
  1. Importing code to automatically generate class diagrams with Software Ideas Modeller currently does not work with .net version 4 or a Debug build just a Release build.
  2. NClass is another UML modeller that has less options but lets drawing diagrams with the standard vb.net icons for methods and properties.
Reference BooksVisual Basic .NET class design handbook
Head first object-oriented analysis and design

Thursday, 19 January 2012

Another Interesting Grading Example

Been doing another urban infill job today here is a quick picture of the grading so far. Four building platforms in a gully with a driveway down the side and retaining walls all over the place.

Modelled with a corridor for the drive, featurelines break lines for the retaining walls and ETW from the corridor.gowing drive

Related Posts Plugin for WordPress, Blogger...