Wednesday, 14 September 2011

Creating Multiple Intersection Assembly Sets for Projects

Typically different projects have different kerb and road construction profile details. If you want to get really organised you can create multiple sets of standard assemblies to match a projects requirements . To do this I
  1. Build an intersection in a blank template drawing with the shipped assemblies. This pulls in all the standard shipped assemblies that I know work into the drawing which you can adjust as required.

    If you have never built an intersection before check out the procedure in the online help here

    Make sure the intersection wizard uses the defaults for everything especially the assembly setting import path and default assembly naming as follows.
  2. Next adjust the assemblies that have been import as required to much the council/project details by changing the kerb height, pavement depths, subbase deep, etc. There are a number of ways to adjust this values i.e Press Ctrl+1 to bring up the properties windows and select each assembly and adjust the values one by one. Select the assembly and right click edit them. The problem with both these methods is the you have to typing in the same values a number of times and you will make mistakes.

    To eliminate this possible introduction of error, I through that you would be able to use match properties command, but this does not work with assemblies objects. So we have to use yet another work around in Civil3d to get something simple done.

    The quickest way I have found to change multiple properties is to press ctrl+3 to bring up the tool pallet find the assembly you want to change and right click and select properties.
    Scroll down to advanced and change to default insert properties to the ones you want
    Now go back and right click the assemble and choose “Apply Tool Properties to Subassembly” then select each assembly in the drawing to change its properties to your project defaults
    Note you have to do this process twice once for the right assemblies and again for the left and you will notice that there is a bug in setting the insert parameter to left in that it does not work and the assembly come in as right handed (hopefully some at Autodesk will pick this up and change it)

  3. Now that all the assemblies have been updated to your project sets we have to save a new AssemblySet to a new folder using the intersection wizard.
    First create an empty shared folder on the network to store your new intersection assemblies as follows
    Next to create the Assembly Set just select the intersection marker and then “ Recreate Corridor Regions”,
pxowrvtv Browse to your network storage folder and press “save as set” What the Intersection Wizard does when saving a Assemble Set is pretty simple. “When you press the create Assembly set button the wizard writes an xml file and creates individual .dwg drawings of each intersection assembly in the current drawing mapped to the intersection regions” The empty folder created above is populated with an xml file and individual drawing of each road assembly as follows
Now you are ready to go just remember where you saved the assembly set and that if you even need to have two or more assembly sets for different intersections in the same drawings you will have to rename the assemblies in one of the assembly sets. To do this to create a simple intersection in a blank drawing using one of your assembly sets and add and extension such as (Type2) to the end of each assembly name and resave it. If you do not do this each time you import an assembly set with the same assembly names either nothing will be imported or you will get a mix and match of assemblies.  
Also If you have the assemblies already setup in older project drawings you can bring them forward into a new drawing by either
  • Copying and pasting the assemblies from the old drawing to a temporary drawing using Ctrl+C and Ctrl+V (I have found that sometimes this does not work and the assemblies spread out into pieces)
  • Another method is to use insert to pull in the drawing with the right assemblies drawing. This inserts the assemblies as a block you have to explode and then purge the block of each assembly from the drawing or you will have two copies of the assemblies.You also have to rename the assemblies in the prospector to keep clean and tidy has (1) gets added to each name.
I tend to rebuild from the shipped assemblies now as some of my older assemblies cause issue in the creation of intersections.

Sunday, 11 September 2011

Ever noticed the Selection Cycle Button Before

I was finishing off a job last week and click on the cycle button by mistake and this selection window came up.
Now I know about it I have decided that getting a list of objects is pretty cool rather than clicking to cycle though the objects.

Tuesday, 6 September 2011

Selecting a Civil3d Profile when its in the drawing but cannot be seen

I am currently busy finishing off a job and for some reason one of the profiles used in a corridor intersection reset all its PVI’s to zero and stuffed up my model.
Tried audit, recover and also tried changed the elevation limits for the profileview to see the profile so I could edit it with no luck. All layers on and thawed.
I knew the profile was in the drawing but how could I select it and edit it when I could not see it. Qselect to the rescue.
  1. First using toolspace I changed the style assigned to the profile to a unique name.
  2. Then a typed qselect and selected the following settings.Object Type = Profile, Property = Style, Value = Unique name of the style
  3. The command line updated saying one object was selected
  4. With the object selected I right clicked and choose Edit profile
  5. Selecting Profile Grid View no data on the profile was displayed.
  6. So using Insert PVI button at the profile view I inserted a couple of new PVI and bang the profile reappeared.
    locked to the intersection. I edited the profile data now available and rebuilt my corridor and everything was great once more.

Saturday, 3 September 2011 code to find average height of PVI in Civil3d

I had an interesting question the other day from a colleague. Did I think you could find the average height of a profiles PVI with an expression? My immediate thought was no.
With a little bit of playing around my initial thought was confirmed.
This is because the general pitfall with labels, be it direct object labels or those nested in bands that use expressions, are that the content available for use in the label or expression are object specific and you only have access to that specific objects properties. (There are the odd exceptions to this but not many that jump to mind).
You should note, however, that the objects properties you do see in expressions are only a limited selection of those object properties that can be accessed with C# or VB .net.
Now, when I first saw expressions demonstrated in an early demo of Civil3d 2007, I thought these labels and expressions are great ! No more text updating. But then I thought, what if you could call sub routines from these labels/expressions to recalculate on the fly as well and update the label ? That would be awesome.  Alas, this is yet to eventuate.
Three wishes I have had for expressions for a while are:-
  1. As above routines could be called from expressions.
  2. That pipe expressions in bands could access all the properties of structures attached to them upstream and downstream.
  3. If statements should be able to return text answers like, if statements in Excel.
Anyway that is enough of a rant , let’s get on with some  
This problem can be easily solved using, to do it I stitched together  a number of bits of code freely available on the web, as I am a bit rusty on coding at the moment having not done any since NZAU a couple of months ago. Here is the process I went though:-
First I had a look at the shipped samples to see if there was an example that worked with profiles to see how to access a profile information. I found one here: C:\Program Files\Autodesk\AutoCAD Civil 3D 2011\Sample\Civil 3D API\DotNet\VB.NET\ProfileSample\readme.txt
To get the example code up and running, to walk through the code refer to the process outlined in my earlier post here Now all of the shipped examples work by generating objects from programmed settings and not by selecting existing objects. That’s fine for shipped examples but in the real world we want to select an object in the drawing and work with it. To see how to do this, there is a good example available here posted by Joshua Modglin . It deals with selecting alignment objects so I downloaded the source code and modified it as highlighted below to select profiles only.
Next, I added a sub routine code to output the calculated PVI average to the drawing as a text.  In line 55 of the code above reference is made to the routine “CreateText”. To create this routine I just took the code from the online developer help here and removed the imports highlighted below as we already have them in our class and do not need to double up.
Then I added the following lines of code to pass text to the sub routine and ask the user for the insertion point for the text.
Once complete I tested the code by “netload” ing the test.dll and calling the new command “Profileaverage” . It worked as follows and you can download the source code here compiled for 2011 32bit.
Unable to display content. Adobe Flash is required.
Related Posts Plugin for WordPress, Blogger...