Ad

Wednesday, September 30, 2009

White House Reality Check

Well I ran across a link to the White House blog which featured a Reality Check. Not quite sure if the White House blog should be attacking other sources, but that’s another issue.

I was discouraged to find another blog post on health care which itself needed a Reality Check of how business works. The Q/A from the post is below:

Q: But what about the fees on insurance companies, drugmakers, devicemakers? Won’t that be passed on to consumers as a hidden tax?

A: No, for at least three reasons:

1. First, the fees are lump sum, not per unit, so you should not expect that manufacturers will pass them on.

  • Do critics really think the drug companies are holding back their prices today out of the goodness of their hearts and would decide to raise them to make up for this lump sum - but couldn't raise them today to get higher profits?

2. Second, these fees are intended to recapture part of the benefits these businesses will get from reform, as they acquire tens of millions of new customers.

  • If you believe the lump sum tax put pressure on them to raise prices, then the fact that they are getting lots of revenue from new customers will reduce that pressure.

3. Third, the fees are all going to ensure that we are increasing the numbers getting affordable coverage and thus reducing the $1,000 hidden tax that millions of Americans pay for the uncompensated care of the uninsured.

  • So even if you believed that somehow companies would find a way to pass them along, that would be more than outweighed by the benefits middle-class families would get from not only hundreds of billions of dollars in health care tax credits but from reducing the hidden tax they currently pay for the uninsured.

The third point is partially debatable, but the first two items are blatantly inaccurate and show a real lack of understanding on how business work. I’m currently studying to take the test to become a Certified Cost Engineer, which includes in great detail on how costing and pricing works, so I’m knee deep on how businesses should come up with what they charge to stay in business.

First lets look at the first reason and I’ll explain why it’s wrong. They state that “the fees are lump sum, not per unit, so you should not expect that manufacturers will pass them on.” Sure they won’t pass them on if they don’t plan on staying in business. A sound business takes all of their costs, both direct and indirect, and come up with a price. Direct costs include labor, materials, shipping costs and other cost directly related to producing or providing a service. Indirect costs are costs that are not directly attributable to the product or service. Indirect costs include overhead items, taxes, fees, etc. Some direct and indirect fees are lump sum, such as a business license, and are easily converted into a unit cost. Since the answerer at the White House doesn’t appear to know how, I’ll do the math. First off lets say a business provides 200 medical widgets to the paying public. They are going to be paying $1,000 in fee for the privilege of providing this product. We take the $1,000 and divide by the number of medical widgets to get the cost per medical widgets. In this example it’s $5/unit ($1,000/200). Fortunately in this country we are able to make a profit which means that the investors in the business want to make a profit, depending on the industry, usually 5-10%. In this example the price of the tax to the purchasing person would be $5/unit * 1.05 = $5.25/unit (not correct, it’s actually higher). As you can see the math is really simple, they teach it in elementary school, and it is quite easy to take a lump sum cost and convert it into a unit cost. The cost will be passed onto the consumers.

The second part of the first reason appears to be a fallacy. It makes it seem like producers of drugs, devices and insurance companies are able to charge whatever they want to increase profits at any time. If got to say this totally ignores the reality of the real world. The insurance companies regularly look at the cost and benefits of what drug makers and device makers charge. If the costs outweigh the benefits an insurance company isn’t likely to provide those drugs or devices to it’s policy holders*. Insurance companies are in the same boat, but with companies and individual policy holders deciding whether or not to stay with the insurance company. Some large companies even cut out the insurance company and self insure. When the government imposes a tax prices go higher because everyone has to pay the fee. If one company arbitrarily raises prices they often loose customers to rivals who provide the same benefits at a reduced cost.

The second reason, well I’m not quite sure what they are going for here. Aren’t the payroll, FICA, property, unemployment and income taxes enough? Why do we need another tax to punish success? I guess they don’t believe the companies will experience higher income taxes from the increased number of customers. They also state “If you believe the lump sum tax put pressure on them to raise prices, then the fact that they are getting lots of revenue from new customers will reduce that pressure.” Wow, a company has higher costs and magically higher revenue from new customers is supposed to make that cost magically disappear. Simply put a well run company takes all of their costs, including taxes, includes a profit and sets the price. A company doesn’t have a stack of costs it puts off to the side that it doesn’t want to pass on to the customers. Poorly run companies have done this, just look at General Motors and its legacy union costs. If you haven’t heard, General Motors went through bankruptcy.

If we can’t trust them on the first two points, how are we suppossed to trust them on the last? I think I’ve proven they don’t understand the basics of business, but somehow we are supposed to believe in this magical savings for the middle class? If they are wrong on the basics, how can we trust them with our health?

* Until the government gets involved and passes a law stating that the drug or device needs to be included, higher insurance premiums result. Insurance company is blamed for higher premiums from those who forced the insurance company to provide those drugs and devices complain that premiums are going up for no reason.

Tuesday, September 29, 2009

Civil 3D Reminders Pack Survey

Please take a moment of your time and take my easy three questions survey (you only have to answer two of the three questions).

http://style.civil3dreminders.com/c3drsurvey

Thanks!

Thursday, September 24, 2009

Noodle House

There is a newly reopened Noodle House next to my office that serves Chop Suey, Chow Mein, Low Mein and a Soup Bowl. 100_0157The restaurant has a limited menu of the above items. They also sell beverages by the can and tea. The menu is below:

090924

 

 

 

 

 

 

100_0156

Tuesday, September 22, 2009

Update Block Attributes

ATTSYNC will update the location and position of block attributes. If you make a change in the Block Editor of the location or position of block attributes, the change won’t be reflected in the blocks already in the drawing. Running the ATTSYNC will make the block attributes reset to the new location of the block attributes as defined in the block definition.

Friday, September 18, 2009

National Comic Sans Day

National Comic Sans Day is October 1st - http://bit.ly/hEgOj.

Up until today I was blissfully ignorant of the font, but apparently there is a big debate between people on the web on whether or not the font should be used.

What's your opinion? Are you for the day or for the comic sans ban.

Thursday, September 17, 2009

Mtext – Remove Color Overrides

Sometimes people do strange things like adding color overrides to mtext. This usually isn’t a problem when using an STB to plot out, but it can be troublesome when using CTB to plot. It becomes especially hard if the color in the mtext is the wrong color and going in to each mtext to remove the color overrides can take a long time. Now this hasn’t happened to me, but the problem peaked my interest on how to create a VBA Macro to remove the color overrides.

The first thing we have to understand is how AutoCAD stores the mtext overrides. Looking in the properties window we can see that color overrides are handled by using \C4; to indicate the color and { } to determine the text the override applys to.

image

Now that we now how AutoCAD stores the information we can remove the overrides. To do this the we need to take the TextString of the mtext object and parse it, remove the \C4; items from the text and then put the TextString back together and have the string be the new mtext. The code I came up with is below:

Option Explicit

Sub mTextChange()

Dim oAcadObj As AcadObject
Dim entbasepnt As Variant
Dim oMtxt As AcadMText

ThisDrawing.Utility.GetEntity oAcadObj, entbasepnt, "Pick mText: "

Set oMtxt = oAcadObj

ThisDrawing.Utility.Prompt vbCrLf & oMtxt.TextString

Dim sNewStr As String
Dim i As Integer
Dim lPos As Long
Dim lPos2 As Long
Dim bOverideColor As Boolean

sNewStr = oMtxt.TextString

bOverideColor = True
Do Until bOverideColor = False
lPos = InStr(1, sNewStr, "\C", 1)
If lPos = 0 Then
bOverideColor = False
Else
lPos2 = InStr(lPos, sNewStr, ";", 1)
' MsgBox lPos & " " & lPos2 & " " & sNewStr

Dim sFirst As String
Dim sSecond As String

sFirst = Left(sNewStr, lPos - 1)
sSecond = Right(sNewStr, Len(sNewStr) - lPos2)

sNewStr = sFirst & sSecond

' MsgBox sNewStr


End If
Loop

oMtxt.TextString = sNewStr

End Sub



InStr(postion, string, character, type of search) looks to see if the character is contained in the string starting at the position indicated. The type of search lets VBA know what type of character it’s looking for.



Left( string, position) collects all of the information in the string to the left of the position.



Right( string, position) collects all of the information in the string to the right of the position.



The code loops around until all of the \C characters have been removed. The final output TextString is below:



image



As you notice I haven’t removed the { }, I did this mainly to keep the code small. Other overrides also use the { } and I didn’t want to put additional code in that would make it difficult. Don’t worry though, the next time you go in and edit the text AutoCAD will remove them for you.



I haven’t tried the code out in all situations. I’m a little unsure what would happen if you did want \C4; included in the mtext. I think you’d want to check to see if there was an additional \ character before it and make sure to skip it.

image





The code in an actual VBA project file may be found on this page: style.civil3dreminders.com/programming

Wednesday, September 16, 2009

Change Manning's

Occasionally you may have a need to change the manning’s value for multiple pipes. Going to in each pipe’s properties can be a pain. Using the API we can change all of the manning’s value for all of the pipes in a Pipe Network.

There appears to be a bug in the API where it isn’t possible to change the Manning’s value directly. It is possible to change the value by temporarily giving the manning’s value a unit value. Once the units are set the manning’s value may be changed. Just have to remember to change the value back. The relevant code is below.

                oPipe = DirectCast(tm.GetObject(oPipeID, OpenMode.ForWrite, True), Pipe)

Dim oPipeCOM As AeccPipe = oPipe.AcadObject

Dim oPartDataRecordCOM As AeccPartDataRecord = oPipeCOM.PartDataRecord
Dim oPartDataFieldCOM As AeccPartDataField = oPartDataRecordCOM.Find("ACMan")
oPartDataFieldCOM.Units = "ft"

Dim oPartDataRecord As PartDataRecord = oPipe.PartData
Dim oPartDataField As PartDataField = oPartDataRecord.GetDataFieldBy("ACMan")
oPartDataField.Value = dMannings
oPipe.PartData = oPartDataRecord

oPartDataFieldCOM.Units = ""
 



This workaround, or kludge, is required for any pipe property included in the part data record that is unitless.


The entire code for this may be found in the Civil 3D Reminders Pack source code. The command to run the program is C3DRChangeMannings if you download the program.

Tuesday, September 15, 2009

Change Layer and Rotation

Sometimes you get a file with text from another source that needs to be put on the correct layer and set to a different rotation. The code below performs the task:

Option Explicit

Sub ChangeLayerAndRotate()

Dim sLayer As String
Dim dRotation As Double

sLayer = ThisDrawing.Utility.GetString(True, "Enter Layer Name: ")

dRotation = ThisDrawing.Utility.GetReal("Enter rotation: ")

GetObject sLayer, dRotation

End Sub

Function GetObject(sLayer As String, dRotation As Double)

Dim oAcadObj As AcadObject
Dim entpt As Variant

On Error GoTo ErrorHandler
ThisDrawing.Utility.GetEntity oAcadObj, entpt, "Pick text/mtext object: "
On Error GoTo 0 ' Turn off error trapping.

If (TypeOf oAcadObj Is AcadText) Then
Dim oText As AcadText
Set oText = oAcadObj

On Error GoTo ErrorHandler
oText.Layer = sLayer
On Error GoTo 0 ' Turn off error trapping.

oText.Rotation = dRotation

ElseIf (TypeOf oAcadObj Is AcadMText) Then
Dim oMText As AcadMText
Set oMText = oAcadObj

On Error GoTo ErrorHandler
oMText.Layer = sLayer
On Error GoTo 0 ' Turn off error trapping.

oMText.Rotation = dRotation

End If

GetObject sLayer, dRotation

Exit Function
ErrorHandler:

Select Case Err.Number
Case -2145386476
Dim Response
Response = MsgBox("Do you want to add the layer to the drawing?, ", vbYesNo)
If Response = vbYes Then
ThisDrawing.Layers.Add sLayer
ThisDrawing.Utility.Prompt "Layer " & sLayer & " added"
Else
Exit Function
End If
Case -2147352567
ThisDrawing.Utility.Prompt "Text/MTEXT not selected" & vbCrLf & "Command: "
Exit Function
Case Else
ThisDrawing.Utility.Prompt Err.Number
MsgBox "Something went wrong"
Exit Function
End Select
Resume

End Function



As an added bonus I even added some error catching.

Civil 3D Quantity Takeoff Paper

I’m writing a paper to be certified as a Certified Cost Engineer (CCE). I’m planning on writing the paper on how to bring the information from Civil 3D into Success Estimator without manually typing the information.

In order to get information for the paper I’m looking for information from anyone who is using the Quantity Takeoff capabilities in Civil 3D 2010. Specifically on how you are using the information. Do you take the output and open it in Excel and then input the unit prices? Do you manually input it into a cost estimating program? How you are using data? Please leave me a comment or email me.

Here’s my draft abstract if you want more information on the paper’s topic:

Abstract

Despite a plethora of software packages available on the market today for cost estimating, interoperability between design software, takeoff software and estimating software appears to be lacking. The program developers have mostly left the transfer of data between programs to manual methods. With civil design software increasingly headed towards smart model based design rather than 2D dumb line work, the interaction between design software and estimating software should be considered. This paper will cover how information contained in the civil design software Civil 3D 2010 may be brought into the estimation software Success Estimator 6.8.7 by utilizing the Success Estimator application program interface (API).

Civil 3D 2010 included new quantity takeoff capabilities. Quantity takeoffs within Civil 3D allow the designer to easily create quantity takeoffs based on the design model. Design changes to the model are reflected when the quantity takeoff report is run at any point in the design. This provides the capability of conducting accurate quantity takeoffs throughout the design. At this time Success Estimator does not provide the ability to import data from a text document or other electronic format. Success Estimator does provide the ability, through the API, to create custom applications. A custom application may be created to import data into Success Estimator contained in the Civil 3D quantity takeoff report.

The Civil 3D quantity takeoff capabilities make it possible to easily perform quantity takeoffs of the design without taking the design into another quantity takeoff program. By performing quantity takeoffs on the model errors may be reduced. By creating a custom application within Success Estimator it is possible to import data from an external source. This ability could reduce errors caused by manual entry of information.

Saturday, September 12, 2009

City of Omaha Sewer Manhole Covers

I had some time to kill a few weeks ago in Omaha, Nebraska and came across a detailed sewer manhole cover.

Farm Visit 013

Omaha also has some planer sewer manhole covers. This one was installed in a catch basin.

Farm Visit 014 

I also stopped by the Josyln Museum. They had some sculptures in the Peter Kiewit Garden. The museum was nice with a wide range of exhibits from different eras.

Farm Visit 008

Thursday, September 10, 2009

Dynamic Blocks – Crop Rows

I’m going to be doing a longer post on using Civil 3D for farming sometime this week or next. I thought I’d start out with creating a dynamic block to help layout the rows of crops. Laying out the rows of crops before hand is important to maximize the plantable land and make sure the water flows in the correct location in relation to the existing contours.

To start creating the dynamic block, type BEDIT at the command line give the block a name.

image

This will open up the block editor. To start create a polyline which will provide the spacing for the blocks. If I remember correctly 400 feet long rows are preferred, which will be the length of the polyline that I’ll add. Next use the Linear Array Parameter Set to create an array. Next double click on the Array lightning bolt to select the items in the set that will be arrayed. Then select the line first created. Now adjust the array width using the properties window. Now exit out and insert the block. The block should be selectable to array the line the distance we want. Once the rows are in place the block may be exploded to get the individual lines and then trimmed. Here’s a short screencast of the steps: http://screencast.com/t/mQQ1HR66R

We can also add additional dynamic block items such as the linear stretch. This will allow the ability to adjust the length of rows. Here’s a short screencast adding the linear stretch: http://screencast.com/t/8iJgIgogvDb6

Notice that the start point of the linear stretch determines how short the row may be. I used the midpoint of the line, if you want a shorter row you can set the start point further down on the line.

Wednesday, September 09, 2009

Create Detached Surface

Back in April I did a post urging people to stop exploding grading objects. Today I noticed an easier way to create a detached surface.

image

Use the Create Detached Surface on the Grading Creation Tools. Select the button and then the grading group. A surface based on the grading group will be created. Much easier than the way I blogged about before and giving you less of a reason to explode grading objects.

Tuesday, September 08, 2009

"I’m Giving it Away" – Results

It took me a while to put all of the names in the hat, but Wendy Miller gets the book. It was close, she only had a one on one chance of having her name drawn. Wendy please Email me with your mailing address so I can send you the book.

VBA IntersectPointWithSurface

In the Civil 3D API it is possible to find an intersection with a surface at a point. To use the method uses a start point and a direction from the point. The direction is a vector. The key to using the code, which took me a while to figure out, is to create an array of doubles, give them the values and then assign the arrays to a variant.

        Dim vStartPoint As Variant
Dim vDirection As Variant
Dim vIntPoint As Variant
Dim dStartPoint(0 To 2) As Double
Dim dDirection(0 To 2) As Double

dStartPoint(0) = 2500: dStartPoint(1) = 2500: dStartPoint(2) = 305
dDirection(0) = 0.6: dDirection(1) = 0.4: dDirection(2) = -0.5

vStartPoint = dStartPoint
vDirection = dDirection

vIntPoint = oSurface.IntersectPointWithSurface(vStartPoint, vDirection)



The code then returns a point on the surface where the direction intersects the surface.

Monday, September 07, 2009

Sewer Lateral Program

The 50th post of this blog was a post on Sewer Lateral Code. Dana Probert, over at BIM on the Rocks, provided a link to the post a couple of weeks back. Since I guess someone out there is using the code I thought I’d update it.

In this version an alignment assigned to the lateral and the mainline pipes isn’t required. There is also an option to choose if the laterals adjust to the Invert, Center or Top of the mainline pipe. Another optional feature is being able to set the minimum, maximum and cover at the other end of the lateral. The minimum cover calculation uses the surface assigned to the pipe, if the pipe slope exceeds the maximum slope, it is adjusted to match the maximum slope. If a surface is not assigned then the slope of the pipe is changed to match the minimum slope.

Here’s a short video of the code in action: http://screencast.com/t/gOgdRiS2ZEnw

If you ever used the original code you will find this quicker and have more options. The code is in vb.NET and built for Civil 3D 2010 (it could be changed to work in an earlier version). Email me if you are interested in purchasing the program (trying to sell my way to AU since trading my way to AU didn’t work too well).

The original code is still free, to get it to work in a newer version of Civil 3D update the references.

Thursday, September 03, 2009

No Man’s Land

I’m in Autodesk’s API No Man’s Land, the land between Subscription Tech Support and not being able to pay ADN fees. For instance I was working on a post last night for a vb.net routine to change the manning's value of a pipe. Everything was going good until I tried to assign a value to the PartDataField. The routine appeared to work correctly, no errors where thrown. Unfortunately the value didn’t change. I looked in help to see if I was doing something wrong, it looked like I was. So I changed the code to match what I understood was help was trying to say to do.

It’s at this point I find myself in No Man’s Land. I could try multiple iterations of different ways of trying to do something. This is problematic since I could be trying to get something to work that’s broken. I could try sending a Support Request (SR) to Subscription Tech Support to see if it’s a known issue. This is problematic, since depending on who gets assigned the SR, I could get either a helpful answer telling me they searched the defect list and did or didn’t find a bug or I could get the dismiss out of hand email telling me to go to ADN (extremely frustrating email). I could go to ADN as the SR email indicated, but it takes $1,350/yr to ask them questions.

There is another option of searching the web, but I don’t know if you’ve noticed, but there isn’t a large source of Civil 3D API code available on the web. Joshua Modglin, posting at www.Civil3D.com, has provided some code examples. There are also some samples on Civil 3D related discussion groups. Other than that I think this blog is probably the largest source of Civil 3D API examples on the internet, and if I’m having a problem this blog probably isn’t much help.

I really wish Autodesk would provide official support to people like me who are in No Man’s Land.

I would like to thank the Subscription Support people who in the past did provide more than just the dismiss out of hand email, I really appreciate it. I’d also like to thank the ADN people who have answered my occasional email in the past, even though they don’t have too.

Now off to find an answer to my question through unofficial means.

LinkWithin

Blog Widget by LinkWithin