Ad

Monday, December 31, 2007

Why Microstation?

ZN posted a comment to my last post on Microstation. The tone of his comment was one of which one to choose, Microstation or Autodesk. That really isn't the point of my posts on Microstation. Even if Microstation is better, I think I will still be using Autodesk products.

First off I work for a leading provider of consulting, engineering, and technical services worldwide (yes, I did copy this from the website). We have many clients with a diverse set of requirements on how their work is performed. My learning Microstation has more to do with meeting the clients requirements than seeing which company has the best software.

If I really wanted to see what product is best, I think I should use the most current Microstation products, mainly PowerCivil. But since client requirements preclude this I don't think any of my posts should be taken as which is best and which one to use. For instance Microstation V7 has a limitation on how many levels (layers in Autocad terms). In V8 an larger amount of levels are allowed. Obviously V8 would be better to use, but I am precluded from using it due to client requirements. From what I have heard Microstation has the same version problems that Autodesk has.

Since I won't have access to the most current Microstation version of the software I don't think I can make a valid assessment of what is better. I did request a version of the most current version of Microstation, but haven't received it after two or three months and have given up on ever seeing it show up.

Friday, December 28, 2007

Microstation - Installed Today

Today I Microstation was installed on my computer at work. We are using the J version and V8 2004 (I may have the terminology wrong here). My first impression is that it doesn't look like Windows, which isn't a bad thing always, but in this case it looks barely better than a first version of a program converted from DOS to windows. The icons look older than they should and it just doesn't looked polished. My first impression isn't good for the Microstation.

I went to help to see if there are some tutorials, I couldn't find any so I just clicked on things and tried to see what buttons did. I didn't have much luck figuring things out. Hopefully I can find some tutorials in the future and learn how to use the program.

Wednesday, December 19, 2007

Slope Arrow Direction

A coworker was looking for a method to have a slope arrow always point down hill. He saw the method at AU, but couldn't find the handout which had it. I found the method on the AUGI web site. Since I will probably need this in the future, and won't remember that I found it on the AUGI web site, I'm going to post it here in the form of a surface slope label.

The formula to use in the expression is the following:

IF({Surface Slope}<0,0,pi)

Put the expression in the arrow component rotation of the surface slope label, see below:

image

The value of pi is used because the rotation value is in radians. If you want the arrow to go the opposite way, just reverse the second 0 and pi. Now if you use the label the slope of a surface the arrow will always point in the direction you want, but the slope will be positive or negative. You could always drop the sign of the label, but that would be too easy. Another way to do it would be to add another expression:

IF({Surface Slope}<0,-{Surface Slope},{Surface Slope})

Tuesday, December 18, 2007

Sustainable Design?

If you haven't heard, sustainable design is supposed to be the next big thing in development design. After hearing some things about it, I'm wondering if people actually want it. I think in theory if you just ask people if they want sustainable design they would indicate they would want it, but in actuality will they buy into it?

Right now I am watching House Hunters on HGTV. It's a show where a couple is followed through their house search. They live in Chicago, so the density portion of sustainable design has been met. But much of what they are looking for in a new place to live goes counter what sustainable design strives for. From what I can tell here are their requirements:
  • Parking for their car
  • Not being close to a subway (mass transit).
  • A larger living space (than their current living arrangement's)

The requirements largely go counter to what sustainable design strives for. The density is supposed to reduce the need for a car, but they need to commute regardless. The housing is supposed to be near mass transit, but the noise created by the mass transit is not something they want to deal with. Well a larger place isn't really related to sustainable design in land development, but it does affect the energy use in the building. A larger place typically requires more energy use, but the energy use of the building didn't appear to factor into their decision. I guess it may have come into play if one of the houses used it as marketing tool to make the a condo/house more attractive.

I guess my real problem with sustainable design is that it's being sold as something people want, but if you watch people and their decisions they mostly (or large portion of the population) don't factor it in their decisions. I suppose the people who put together the sustainable design want the designs to be that way? Or do they too not live in houses that meet sustainable design? I know I don't, but I don't think that is going to stop me from working on sustainable design projects and assisting my company in marketing it to potential clients. Isn't that all it will be in the end, a marketing tool without much real meat behind it?

Friday, December 14, 2007

VBA: Export to Excel and Then Some

On the 6-30-2007 date on this website I previously posted a VBA macro to get pipe and structure quantities from a drawing. This is an example of how to export information to Excel and then modify it. So lets say you thought it was neat, but wanted to change what it did in Excel and didn't have much VBA experience. An easy imageway to see what direction you should go in would be to use the macro recorder in Excel. To get to the macro recorder in pre-2007 its under Tools => Macro => Record Macro. In 2007 you will have to go to the Microsoft symbol and select Excel Options. Under popular, check the "Show Developer tab in the Ribbon".

In the Developer tab use the Record Macro button and press Ok when the Record Macro dialog box pops up. Excel will now keep a record of all of the movements and commands you do. Do what you want the routine you are creating to do. When you are done press the Stop Recording button (before 2007 it is on toolbar imagethat pops up when the recording starts, in 2007 it is on the Developer ribbon). Once you stop the recording choose the Visual Basic option to see the code that was created.

image

The code Excel created is in the next picture. It will take a little work to make AutoCAD do the commands in Excel, but the sample mentioned earlier should start you on your way or take a look at the AU class I did which has another example.

Microstation

It looks like I may have to learn Microstation in the next few weeks. Should I post about Microstation here or do you want have this site only to be Civil 3D?

Vote in the poll on the right, majority rules in this case. The poll will be open for a week.

Tuesday, December 11, 2007

VBA: Create Existing Ground Profile For All Alignments in a Drawing

I saw a post today in the Civil 3D DG that reminded me that I wanted the functionality to create existing ground profiles for all of the alignments in a drawing. I don't want to wait for Autodesk, I want it now. Well this is how I created it today.

As a starting point I am going to be using a renamed copy of the VBA profile sample: C:\Program Files\AutoCAD Civil 3D 2008\Sample\Civil 3D API\Vba\Profile\ProfileSample.dvb

To start I'm going to go to the Profile module (CreateProfile macro) which contains the code to create profiles. Since it creates both an existing ground profile and finish grade profile I will delete the codimagee portions that relate to creating the finish grade profile. I don't want to create a profile so we will delete that code also. Since I am doing this just for my own use I will delete the portion that gets the collection of profiles. The picture to the right is what I was left with.

Since you probably have surface you want already in the drawing we will change the surface to one that you select in the drawing. To do this use the following code:

' Get the specified surface.
Dim oSurface As AeccSurface
Dim oAcadObject As Object
Dim entbasepnt As Variant

ThisDrawing.Utility.GetEntity oAcadObject, entbasepnt, "Select a Surface: "

If (TypeOf oAcadObject Is AeccSurface) Then
Set oSurface = oAcadObject
Else
MsgBox "Selection was not a surface"
End If

Instead of using the default name that the sample uses I will use the alignment name and then the surface name. To do this I will Dim a string and then store the data name in the created string. Make sure to replace the instance of PROFILE1_NAME with the string variable created, in the posted code I used ProfileName. So that is all of the changes that need to be made to the profile module. Next we will select all of the alignments and then send the alignment name to the CreateProfile Function to create the EG profiles.


As a starting point I will be using the PerformProfileDemonstration code in the Subroutines module. First I will delete all of the routines I don't needimage (I will keep the CreateProfileView code in case I want to use it later in another post, but I will comment it out so it doesn't call the code). To select the alignments we will use a snippet of sample code from the pipes sample. It essentially looks at all of the objects in the drawing and checks to see what type of object it is. I will be doing this change in the subroutines module. So to the left is the code I finished with.


Now if you hit play, you would find that I cut to much and made a bunch of mistakes, but hey its free post. The first thing we want to do is make sure I declared all of the variables correctly. Once those have been fixed I will need to add back in some of the code I deleted earlier. Mainly it was the Profiles collection and the name of the style. For the style I used Standard, but you could replace the name with any that you have in your template.


Now that everything is fixed I hit play. I got the results I was after, but I had to select the surface multiple times. To prevent from having to select the surface every time I will pull selecting the surface out of the profiles and put it into the subroutines macro. To pass the surface from the subroutines macro to the Profile macro I needed add oSurface As AeccSurface to the title of CreateProfile and then add it to where we call the create profile function.


The finished sample can be found here with a date of 12-11-2007. If you run it more than once it will just overwrite the existing one and will not create a new one, but if you have a finish grade profile with the same name it will overwrite that one. There is some more work to be done to make it error free, but should work for my purposes and only took about 2 hours including the time to write this.

Monday, December 10, 2007

Views and Sheet Set Manager

I usually forget to use this but you can use Sheet Set Manager to take model space views from one drawing and place it into the layout of another sheet. To do this open sheet set manager and go to the Model Views imagetab.

Right click on the Add New Location... and add a new location. Select the folder with the drawing(s) you want to access the views in. Expand the drawing with the view that you want to add to another sheet's paper space.

Once it is expanded drag the view imageinto paper space or right click and choose Place on Sheet. Now you can place the view on the sheet at the default scale or right click and choose the scale to add the view as. The command adds the referenced sheet to the current drawing as an xref.

Sunday, December 09, 2007

Views

When you open a drawing you can specify what view the drawing opens to. Just open the drawing using the Open command in windows. Check mark the Select Initial View option in the dialog box:

image

Once you select a file to open another dialog box will come up to let you choose what view you want to open:

image

Select the view you want and then press OK and the view you chose should be the view you see when the file opens. The M indicates model space and if a P shows up it indicates a paper space view.

LinkWithin

Blog Widget by LinkWithin

Ad