Clean up some of my noob mistakes* so that it'll work within a VBA project.
I've also added some basic formatting.
* Objects not dimmed
* Bad ordering
* Spelling mistakes
' written by evereux
Option Explicit
Sub CATMain()
On Error Resume Next
Dim Excel As Object
Set Excel = GetObject(...
> If you can help me in getting the material, density and mass for single CatPart with multiple bodies (ie.. for the above Macro)
Try reading the V5automation.chm file that comes with CATIA. Cross reference that with what I've done above and should be able to work it out. I've done all the hard...
Yes, the macro above is only designed to work with a single catpart that has multiple part bodies. I'm trying now to create macro that iterates through an assembly. I'll post the result when I have that (hopefully this weekend). But, it won't process all the part bodies within the part. You'll...
After much blood, sweat and tears I got it figured out. I hope this proves useful to other people.
The code isn't particular clean or easy to follow at the moment sorry.
Sub CATMain()
'Before launching excel, make sure it's closed.
On Error Resume Next
Set Excel =...
You could use overload properties on the view and hide the elements you don't want (you can jump to product and select products / parts).
Or you could modify links on the view.
Probably better than hiding elements in the product itself to generate your view as the above methods will remember...
Here is a GSD modelled part.
It's not quit sized correctly but it's all constrained in a fairly robust manner and should be easy to change to suit in minutes.http://files.engineering.com/getfile.aspx?folder=6666e2af-6ebb-4f5d-ad30-b9b4ea40d072&file=BRACKET_GSD.CATPart
Hi,
I have a CATPart that contains multiple part bodies that is open in it's own window. I'd like to iterate through all the part bodies and output bodyname, Area, CofG, Inertia (Ixx, Ixy, Ixz) and mass.
I have the area and CofG working fine but I can't find a solution to retrieving the...
I've created my first useful macro which creates a line normal from a multi-section generated surface using a point that has been created along a curve. You need to select the items first with the surface being your first selection. Also, you should have a geometric set called Vectors.
I share...
That's a nice tip!
I found SelectElement2 in the V5 automation handbook which if anyone is interested says this:
SelectElement2
Runs an interactive selection command.
Role: SelectElement2 asks the end user to select a feature (in the geometry or in the specification tree) in a Window of the...
Cracked it.Simply
Set hybridShapePointCoord1 = parameters1.Item(Point1.name)
Set hybridShapePointCoord2 = parameters1.Item(Point2.name)
Should have been
Set hybridShapePointCoord1 = Point1
Set hybridShapePointCoord2 = Point2
Therefore it could be simplified further by sayingSet...
Hi,
I'm trying to get my head around CATScript and thought I'd start by writing something very simple so I could get my head around some basic concepts. Mainly, selecting items and using those to create geometry. The task is to select two coordinate points and then draw a line between them...
Hi,
I'm very new to scripting in CATIA but I was hoping to gain some help to get the above working. I've had to make some changes to get it progress a little further without erroring ...
1. Add a ' to Next line at the end of the script.
2. Changed Set hybridShapePointOnSurface1 =...
Hello dtwo,
I'm using Catia V5 Release 21 x64 on Windows 7 x64 and don't notice any speed problems after using various iterations of V5 on XP for many years. In fact maybe the opposite ... we only just recently moved up to R21 and I swear it's a little quicker but that's also probably in my mind.