Setting up ASP.NET and SQL Server – frustrating windows security

Sucking Access files into SQL Server… Setup steps:

Now I am getting the error: The database owner SID recorded in the master database differs from the database owner SID recorded in database ‘proSteelMtoPartsList’. You should correct this situation by resetting the owner of database ‘proSteelMtoPartsList’ using the ALTER AUTHORIZATION statement.

It COULD be the user- but look around first on your database properties (right mouse click). I followed these links and REALLY messed things up but with some quicky DROP and CREATE TO scripts, I had another one going in no time. DO NOT do the steps in these links unless they WILL help, but they help with understanding and figuring out current settings. I did NOT restore from a backup – so that is why I should NOT have followed the steps. Never set the owner to sa either unless you have access to that account AND you have taken your account off of the dbo member list.

This person has some GREAT explanations:

What it turned out to be is a couple of things – like the trustworthy – should have been run and to NOT use the statement in the stored procedure – however, this DID fix a problem on another database

  • execute as user=’DOMAIN\my.username’ – which I used for

Annotation in AutoPlant

This is the process I used to find out how the annotation Instrument Balloons function works:

  1. started by opening tools->customize->interface to find the function name for the menu button “Instrument Balloons…”. I found the function “AT_Annot_InstrBubble” was accociated with the menu button.
  2. After searching for the function I found it in C:\ProgramData\Bentley\Plant V8i\elect\at_elect.mnl, which is a LISP file, the function was contained within lines such as “Line 473: (defun c:AT_Annot_InstrBubble_T1   ()  (at_Piping_annotateComponent “InstrumentBubble_T1″)  (princ))”.
  3. By searching for “InstrumentBubble_T1” I was able to find the file annotate.ini under C:\Program Files (x86)\Bentley\Plant V8i\Config\metric\piping (metric is unit system your drawings are set in, can also be imperial or mmetric), this ini file contained the classes for “InstrumentBubble_T1”
  4. the only line that contains a function call is the “textFunction = at_Component_annotateInstrumentBubble”, there are 2 files that contain this function. The first is Annotate.ebs, this has the function definition of at_Component_annotateInstrumentBubble and other annotate functions. The second file is methodes.ini under  C:\Program Files (x86)\Bentley\Plant V8i\Modules\Base. The methods.ini file shows that at_Component_annotateInstrumentBubble is related to the Ann_InstrumentBubble_Method, which is part of the overall base commponents method.
  5. To find which sub methodes are used I went into the respective files and in each function I placed a message box outputing the function name. Running the desired function I determined that 2 functions from this method were called, then other functions I haven’t been able to Identify run afterwords (these functions are not part of the Base_Component_Method). The functions that I can identify create the first dialog box, the functions that run after the dialog box open a second dialog box then draw the annotation.
  6. Base_Component_Method acts as the method key for the parent class of each module such as HVAC or CableT.There are no functions in this method key that contain a draw function or call a draw function.

Git for dummies? Here are some resources to get you started.

Git for dummies. There is no such book, however, here is a quick guide once you know what is going on. Here is another SUPER link and he deserves some sort of peace prize.

Another link is a dummy like resource for newcomers to your team. I have used Git for about a year, but it was only for one or two of us. Now that there is a whole team, we needed a little more knowledge and rather than teach everyone one by one, I thought I would make this post. If you have used SVN, git is a little more intense.

An online book is here. Bare vs. non bare git repository is important to know – check here.

Adding a component with a weld or glue in the MTO (BOM)

search_paths_bentleyIf a piece of rigid PVC conduit is placed in Bentley AutoPLANT, then you will see a red dot or placeholder get added along with it. This comes out in the BOM as a glue. If you place enough of these, it counts the welds. How does this work – can I do the same for kits of stuff like joints or fasteners along with each piece of cable tray.

This is a log of my discoveries on ripping AutoPLANT apart to see how it works so I can create my own components like these so that items can be included as attachments in the MTOs or BOMs created. Continue reading

Installing IIS and ASP.NET – installing things so you can get your website up and running

I have gotten a lot of issues of tinkering with IIS solved before – but never have I written anything down and I have never installed it from scratch. Now, I have to do these steps again so this time I will write them down for myself and others. I will not be using the default website.  I am doing so on Windows 7. Note that this is on the Intranet – so security is NOT my main focus although it is on my mind while setting it up but I am not going to be crazy on that in this discussion – just mention a few thing here or there that you might want to think about. This is where I started from a tutorial standpoint – but I am going back to this once I am done. There is a great MS tutorial in the 1st link in the install section below.

UPDATE: This little step of registering IIS (aspnet_regiis.exe -I) after install has gotten me SOOO many times. ALWAYS do this – see this link.

Install MS Visual Studio Express 2012 for Web

  • download from Microsoft and follow the instructions
  • http://www.asp.net/web-forms – great tutorial site too
  • register it, MS says its free but you have to register – ok – no issues
  • you will require a reboot

Install IIS

Bentley AutoPLANT Environment variables or % variable list

I always said I would do this and I have hit the last straw since I need it often – here is a list of them all. [1 week later] – some of the items are defined in the [ALIAS] section of the AT.INI file in C:\ProgramData\Bentley\Plant V8i\CFG\AT.INI

  • %APP_DIR% is simple the short directory name of the application that you are using.
    • For example, if a file is stored here, the app is the SHORT bolded text
      c:\My Favorite Project\ELECT STUDY\Config\modules\CableT\piping\Draw\myfavorite_drawing_vb_file.ebs
  • %PROJECT_ROOT%
    • – using the same example as above, it is the bolded text
      c:\My Favorite Project\ELECT STUDY\Config\modules\CableT\piping\Draw\myfavorite_drawing_vb_file.ebs
  • %NETWORK_ROOT% –c:\Program Files (x86)\Bentley\Plant V8i\Help\MyFavoriteHelpFile.chm

    but don’t let “network” fool you as it is most likely on your computer

  • %Local_Root% – not sure yet – but here is a samle context: %Local_Root%\modules\AT_CBLTR.mnu
  • %CUSTOM_ROOT%=C:\ProgramData\Bentley\Plant V8i\Bentley Plant V8i Configurations\
  • LOCAL_ROOT=C:\ProgramData\Bentley\Plant V8i

Bentley AutoPLANT coding best practices

  • comment lines. There can be too much – but not likely – comment, comment comment
  • use camelCase for variables – classes – use a capital letter to start
    • avoid underscores
    • never use spaces
  • prefix all functions with elb_ or your company name
  • document with pictures
    • use a blog
    • if you store pictures, do so in an easy to transport tool like powerpoint – because everyone has this as a tool
  • all code should be version controlled. If you don’t have one, download SourceTree a github.
  • where possible feed in only human understandable variables -the least possible
    • these variables should be well documented via a blog and this url linked into the code comments at the top.
    • let your computer program do all the hard work with math
    • there will be some hardcoding like the thickness of a peice of metal – however, with “hardcoding”
      • avoid it when possible
      • never hardcode in-line but abstract a niceVariableNameWithCamelCase and then assign the hardcoding to that. Use this variable over and over.
      • put all you hardcoded variables at the top of your routine

Specification Field Definitions retyped.

When you print the spec fields and their meanings to pdf using the print driver I had, it jumbled many words – Hence I copied it here for my own and your reference – I added a few columns for a colleague s well to add more electrical context than the piping-centric docs would naturally give. The AutoPLANT Component Use column is originally from Bentley (this is my attempt at getting over any copyright concerns – this is NOT my work but Bentley’s)

The spec gen help is OK, but it does not have an ‘overview’ feel. Here is a link to someone who already put together an article with links to good information. Unfortunately, the picture links don’t link his pictures and diagrams.

Note: ** indicate that the field will affect the system ID for the component

# Field Name Specs
asked
for …
What should be asked for AutoPLANT Component Use
Continue reading

Making a new electrical component in raceway/electrical package – Start to Finish

This tutorial / step-by-step can be used as a training manual. If you want the log book style article on how to figure all this out see the other article. No lesson in Bentley Docs describes this. There is a help file on linking in the Equipment Modules as a .ebs drawn entity and how to edit those classes. This is for the Piping module side of things for Electrical items – the concepts can be used for any piping module application.

Step 1. Start Class Editor and gather info

  1. Open your Class Editor
  2. Open your project under the menu File->Open Continue reading

Notes on Making a new Class for Bentley AutoPLANT electrical components (Raceway)

class_heirarchyThis is my log on figuring out how to make new Electrical / Raceway (piping module!) components and I hope to help you know the ins and outs. From this, I made another post which is more “do this, do that, etc.” for those that just want to get things done. I needed to write down many notes, so I did so here as it is quicker to type and I can copy/paste stuff back out of this article as I needed the info.

Basically, my spec gen is broken and there is no help available to at the moment so how do I make a new component in the piping module/app? Electrical components seem to piggy back on this module as well. Since I will be referring my handwritten notes as this happens in spurts and I will need to refer to it in 6 months, I thought I would write things down.This will also be used to train on this stuff once I clear the way in our electrical department. So how do we get new specs, new drawing files etc. How is this hole spec, drawing, database thing linked? This too will be answered along the way for you to follow. If you know why my spec gen is broken let me know (here is a link to my exact woes which others have too) Continue reading