Thursday, 31 May 2012

Making your own Civil3d Custom Pipe Rules

You can make your own custom pipe and structure rules for Civil3d to model your local requirements. To do this with vb.net is a little bit involved to start with but worth the effort. To get started

1. Copy the sample vb.net pipe project folder and all its contents that ships with Civil3d from the shipping location
C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\Sample\Civil 3D API\C3DPipeNetworkRules
to a new location.

2. Open up the project solution file in Visual Basic Express IDE
3emsiimm

3. Fix up the references in the project so they point to the correct paths on your local machine

ckifa2ha
clip_image002

4.Rename the project to be some thing like C3DPipeNetworkRulesCustom
pbyllo0n
5.Set the build output path to the location where Civil3d xml pointer file is going to look for pipe rule files
yji2swtp

6. Set up the Debug application to be Autocad by opening the .vbprog file and adding the following two lines
jpjkfrf1

7. Setup a custom pipe rule .xml pointer file for Civil3d to load and display your custom rules for selection in Civil3d. As far as I am aware this is not documented by Autodesk anywhere Chris Fugitt from Civil3dReminders summaries the process in his AU2007 paper (page 18 on) which has disappeared from the AU site as it is to old, but I have uploaded here for reference. Hopefully he gets to present the information again at AU or Autodesk add it to the help.

8. I already have a modified .xml with three custom rules added for VBA that I wrote back in 2008 but it has a couple of issues in Civil3d 2012 a new rule PipeEndLocation was added by Autodesk which is missing from my file and the rules point to the old VBA .dvb rules file and not a new vb.net .dll therefore do not work unless VBA has been installed on your PC.
s44crmcg

9.So to make an updated xml pointer file I made a copy of the new shipped .xml file and copied and pasted my custom rules in xml notepad from the end of the old file onto the new file by having two session of xmlnotepad running next to each other.
nwx24mlu

Now I adjusted the path to point to the dll and the macro text to what I am assuming should be the “rootnamespace” followed by the class name in the vb.net project.
djvqfncm

10. Now I have been unable to get my old rules to run using the vba to vb.net conversion process so I am am going to have to make the same updates to the copy of the shipped .net pipe rules file as I did to the vba file back in 2008. So in the project file make a few name changes to know where the new rules code is.
2bxtd4kb

11. Now swap out the shipped xml pointer file with your updated xml file.
hugd3ezv

12. Go back to Visual Basic Express and launch a debug  session by pressing the play button. This will start Civil3d and we will be able to check if the new rules are available and we can debug and step thru your custom pipe rule .dll file
gpsad02d

13. Problem I can see the rules and they appear to be pointing to the right .dll file but Civil3d cannot fire the rules in the.dll. Does anyone out there know what the issue could be or have custom rules running in 2012.
tms30mgu

Thursday, 10 May 2012

Section Centre Line Labels

Following on from the post a couple of weeks ago I have made up an expression to help me label just the centreline levels on my sections. I have to make use of expressions again to minimize the labels you do not want to see by reducing there height.msnbvvhg

as follows

k3yy3l1y

to make them disappear I used the following expression for the text and block height if the offset is zero it makes the objects 2.5mm high otherwise make them 0.01mm high.

5tyacn2s

bieyeb3g

rr0cvb4p

3ucdukga

Monday, 7 May 2012

Too AU or not to AU that is the question?

Looking at going to AU this year seeing I have collected enough airpoints on the old visa. Would like to do a paper on something but have to submit it and get it accepted first. Paper Ideas have to be submitted by 22 May 2012.

Here is a list of ideas I came up with for NZAU last year number 2 and 3 made the cut in the end. Anything look interesting? or any other ideas come to mind from my previous blog posts? I maybe a bit rusty on the programming side as have not done any for a couple of months.

1. The Pipe Paper I did for NZAU 2009 but that needs a rework and is bit old now (for me anyway).
2. Urban infill subdivision lot grading on steep terrain. One persons workflow for getting the job done when C3D grading is pushed to the limit.
3. Six time saving tools in 60 minutes. So you know how to open vba or vb.net but what can you do with it. Step thru the creation of 6 time saving tools in vb.

Label assemblies in one click
Swap pipe parts in profile view
Points from text - take those old 2d drawings and make them 3d
What point groups is this point a member of
Editing Parcel labels on import to remove unnecessary naming information (Land online)
Tips and tricks for Controlling the user interface

4. Piping at maximum Velocity. Create a VB project so that after three clicks your long sections (ProfileViews) are done.
5. Subdivision modelling my way as they are not highways.
6. Modifying the UrbanSideway assembly with VB to include topsoil depth for berms and to generate a turn bottom links surface for bulk excavation.
7. ProfileView Generator - Create a tool in VB to generate multiple Profileview in one click, store and save setting for generating various ProfileViewtypes in the one drawing with the same click.
8. Write your own custom pipe rules in VB.net
9. Introduction to vba, vb.net, lsp?
10. Master those layers my tips and tricks for working with all those layers in Civil3d
11. Catchment Modelling with Storm sewers and Parcels
12. So you want to use Vault this is what I know
13. Modelling Watermains and Pressuremains with Epanet and Civil3d Pipe Networks
14. How I Structure projects to be a jack of all trades

Wednesday, 2 May 2012

Winters on the Way

Thought I would post a photo from my office desk of the Remarkables Mountain Range on this beautiful blue sky day in Queenstown with the first sign of snow from the weekend. Time to check the ski gear still fit’s the kids ready for winter and the start of the ski season in June.

Image1408

Add Featureline Site to Quick Properties

I few years ago Tony posted on how to modify the quick properties Dialog Box to add pipe data which I have used for a while
http://tonyscivil3dworld.blogspot.co.nz/2009/10/modifying-quick-properties-dialog-box.html

For featurelines however i have been just using the list command to check a featurelines site but today I thought maybe I can add it to the quick properties and sure enough you can.

zlmrbcvz 

 

ulqtcde3

Monday, 30 April 2012

Civil3d Sections Composite Surface Slope Labels

If you are like me and do a lot of site earthworks you work with corridors, parts of corridors, gradings and breaklines to built up a finished composite surface. This is fine until you cut some section down one of your corridors and then want to label the slopes of your composite finished surface. If you try and use a segment label to add the percentage grade the first thing you will notice is you get alot of labels most of which you want to delete and you can not reduce the number of labels with weeding as it is greyed out.

tqalvofn

To get partly around this limitation in Civil3d i use a grade break label with a number of expressions to weed down the number of labels that appear on the section by weeding on the change in angle of the section of the finished surface. Lets face it we are only interested in having a Labels when there is a reasonable change in grade.

 kn2xd5wi

I have the following expressions setup under grade break labels.
3s545b3k

Weed Angle is just a place holder for the grade you want to weed by in this case 3% so you do not have to go into the more complex expressions.
mltn4ujy

GradeChange is  Section Grade In – Section grade Out
infi12wq

Text Height Based on Weed Angle is main equation and the tricky way to hide the labels you do not want to see by reducing their height to some thing really small. First I check to see if the grade is near infinity with and if and if true make the label 0.01mm high the smallest value you are allowed. Next I check the Absolute value of the Grade change against the weed angle. If the change in angle is smaller than the weed angle I make the label really small (aka hidden) other wise I make it just the normal height.
kvjep2ea

GradeOutToDegrees is used to get the angle at which the label should be rotated to be parallel with the out going section segment of the surface.
upsyfreq

Once all the expressions are complete it is just  a matter of referencing them in the label.
ty0sjrhb

I suggest when you start with expressions you add them to a check label to see what answers you are being returned so you can see what way to head.
ka0yrxbx

How this method is by no means perfect and sometimes labels are missed in key areas. No problem just click one label you can see to highlight the grips of all labels present in the drawing.
o3nauhan

Now select the grip on the section line of the label you want to show and drag it a small amount to have the label appear. Now instead of deleting useless labels you are just showing the ones you want. HTH
y40t3toy

Related Posts Plugin for WordPress, Blogger...