Sunday, February 26, 2012

Learn how to create CATIA Macros Video Tutorial

Do you want to learn how to write VBA macros in CATIA V5? I've created a new step-by-step tutorial video to help teach you how to create macros in CATIA V5. Topics covered in the video include:
  • How to add a macro library
  • How to open and run macros
  • How to create an icon for your macros
  • Create a "hello" message box macro
I'd also like to take this time to introduce my brand new site, VB Scripting for CATIA V5! I've created an expanded edition of my book of the same name and included 100 additional pages of how-to tutorials. There are also several articles to help get you started learning the key concepts of writing VBA macros. I'll also be introducing an email newsletter with free CATScripting tips! So watch the video below and check out the new site.


The CATScript Msgbox code used in the tutorial:

Sub CATMain( )
  Dim strHello As String
  MsgBox strHello
End Sub

Tuesday, February 21, 2012

Solid Edge Synchronous and Ordered Modeling Video Tutorial

Ally PLM released their latest Lunch Byte video tutorial, this time covering the topics of synchronous and ordered modeling. These videos are meant to showcase some of the feature of Solid Edge that you may not be aware of. Watch the embedded tutorial below to learn about how synchronous modeling accelerates the design process allowing for fast and flexible edits.

Sunday, February 12, 2012

Learn AutoCAD for Dummies Review

AutoCAD is one of the leading 2D software used by engineers, architects, and designers. AutoCAD 2012 for Dummies quickly brings readers up-to-date on the latest version with all the new additions and revisions to the program. This book includes great colored illustrations and tutorials to help users better understand the material. This book was a huge help to me, someone used to running AutoCAD 2005 when I needed to, but am now making the upgrade to AutoCAD 2012. Believe it or not, even with model based definition where data is contained with 3D models, I am still needing to go to AutoCAD from time to time to whip up a quick drawing for a fixture or jig. As a mechanical engineer, it never hurts to stay up to date on the latest software available and this book is a great way to do that.

I do want to note this book is written specially for Windows users (sorry MAC peeps).

Purchase AutoCAD 2012 for Dummies and start learning how to use AutoCAD today!

Saturday, February 4, 2012

Download Architects Cad Drawings

Are you looking for AutoCAD symbols, details & drawings? Download Architects Cad Drawings contains a huge database of downloadable CAD symbols, drawings, details, and building templates in AutoCAD format. This symbols are perfect for creating floor plans or site layouts.

This is the perfect resource for CAD draftsmen and CAD technicians. There are over 6500 CAD files to download from. Click Here!

Wednesday, February 1, 2012

VB Scripting: CATPart Description Macro Example

How do you return a CATPart or CATProduct description with a macro? Using VB scripting you can use the following CATScript code to loop through all the parts within a product assembly and return what the description is. When you right click on a part within an assembly you will actually see two description boxes - component and product (pictured below). 

The top description name in the box is for the component level and can be called using DescriptionInst which returns or sets the product's description for a component product.  The bottom description name is for the product and is found through our script using DescriptionRef which set's the product's description for a reference product and is a property in the object product. Getting the part description may be useful in creating bills of materials or other part list documents.

Sub CATMain()

Dim productDocument1 As Document

Dim product1 As Product

Dim products1 As Products

Set productDocument1 = CATIA.ActiveDocument

Set product1 = productDocument1.Product

Set products1 = product1.Products

'count the number of CATParts within the catproduct


msgbox"CHECK: The number of parts is "&partcount&". Please click OK to continue."

Dim i As Integer

'loop through all parts

For i=1 to partcount

'apply design mode to each part

products1.Item(i).ApplyWorkMode DESIGN_MODE

Dim partDoc1 As PartDocument

Set partDoc1=products1.Item(i)

Dim getDes, getDes2 As String

getDes = partDoc1.DescriptionInst

getDes2 = partDoc1.DescriptionRef

Msgbox "Component description is " & getDes& " and Product Description " & getDes2

Next 'i

End Sub

To rename (or to enter a new name) to your part description field use this code by adding it to the above text during the i loop, before Next and after the msgbox:

partDoc1.DescriptionRef = "Test"

partDoc1.DescriptionInst = "CompTest"&i

The first line will add "Test" to each product description field while the second line will add "CompTest" and the loop number. So for the first part in your assembly where i=1, after running the macro the component description will read "CompTest1", the next part "CompTest2" and so on.

See more examples like these in my new How To book VB Scripting for CATIA V5.  Visit my new site for even more CATIA macro programming tips here!