How Bentley AutoPLANT integrates a new class, methods and speckey WITHOUT editing the core program files

Lets assume that a new spec was created. AutoPLANT has a very clever structure to its files so that the core ones that come with AutoPLANT need not be touched. It also helps when new specs, ebs, classes etc. are added (specs beyond just adding or changing dB rows). This article outlines how to integrate a new component where a new class was created. There is already an article which outlines how to create a ‘new spec’ (a complete one which includes class/ini sections, ebs files and mdb rows) to do this AND there is an article that outlines how that last article was figured out, so that you too can do find out more complicated classes like joints etc. for yourself.

Lets assume that you have all your files / edits ready to go. A pseudo and realistic example is at the bottom. Continue reading

How to do an-SQL join AND get the latest date without a sub-select

Here is some discussion on a one to many join that needs the many side to return ONE row – the latest one. Also in this article are many links to the related items. It took about an hour to find solutions without a sub-select. Sub-selects are VERY popular – could this be because they are easier to understand and more logical? Many articles still claim that sub-selects are slower especially when there is no correlating field between the sub-select and the outer select statement.

http://stackoverflow.com/questions/2111384/sql-join-selecting-the-last-records-in-a-one-to-many-relationship

VBA for AutoCAD: getting a command line filename or a dialog window filename

The following code prompts for a full path or press E to invoke a dialog window typical to Microsoft to choose a “Save As” style windows path. Eventually an Excel file path that is fully valid and vetted will result.

Here are 2 basic ideas wrapped within eachother

a) Outer: Is there a valid filename (valid string) or did the user cancel (False),
b) Inner: Go get the filename via command line or optional dialog window – this might give garbage- hence, the above line has “valid”
Note we can ONLY do this because you already using the Excel libraries as you are writing an Excel file with this path. There is equiv. commands without this cheat.

You want to make your code contain TestVettedExcelName style code – then you can use the Functions with no issues.

[vb]

Sub TestVettedExcelName()
Dim name As Variant

name = GetVettedExcelName
<!–more–>
If name = False Then
‘ something went wrong
MsgBox (“No file selected or path is not valid”)
Else
MsgBox (“the name is: ” & name & “and is a valid string”)
End If

End Sub
[/vb]

Continue reading

Configure Access to SourceTree to Gitorious Source Control

Overview:

  • SourceTree is a visual client to a git-style source control repository for Windows (in this example) and Mac-OS-X.
  • Gitorious is a wiki/git-style web based file browser and repo setup system like github – except YOU run it.  It is delivered as standalone computer (Virtual Machine) that hosts a git server and wiki all in one. The wiki is integrated into the project. My good buddy at Geek Inc. delivered this all on a 4GB stick which had a VMWare AND a VirtualBox version of it and then he and pointed me in the right direction. Thanks Ben.
  • IMPORTANT – EVERYONE ELSE CAN VIEW PROJECTS PUBLICLY WITHOUT WRITE ACCESS (awesome!) – meaning they don’t have to know git – just send them links to the relevant directories or files AS A WEB LINK – they don’t have control over your files since the files are stored on the Virtual Machine’s internal directory structure. They can make their own accounts – but the admin determines who is on what team for write to the repository. THAT WAS THE GOAL
  • Ideally there Continue reading

How to publish a Paypal button in WordPress and not have it change with a re-publish

Publishing Paypal buttons or other HTML code into your wordpress blog works great the first time, but upon subsequent saves, it can be downright frustrating because the HTML you pasted into the HTML view gets changed. With a simple abstraction using a snippet tool/plugin like HTML Snippet (XYZ Html), the code you intended can stay right in the article each time.

Watch this Youtube Video – it was written for one of my customers. But the basics are:

  1. In Paypal, make a paypal button & copy the button’s HTML code
  2. In you wordpress blog’s HTML Snippet (aka XYZ Html), copy the code and give the snippet a unique name
  3. Paste into your blog or article, the snippet tag/line/code (copy and paste it from the list of snippets)
  4. Publish your blog or article