My guess is you cannot count the number of leaders because there is no Count method. Try removing the If and end if.
DrawingLeaders (Collection)
IUnknown
|
+---IDispatch
|
+---CATBaseUnknown
|
+---CATBaseDispatch
|
+---Collection
|...
I agree with itsmyjob, you need to take a look at your bodies collection after you reassign the partbody.
Prior to pasting, if there is only one body in the part, just set that to a variable and delete it after you paste
Set oBodyToDelete = oPart.Bodies.Item(1)
'Paste...
There really isn't enough info here to be able to answer this.
It sounds like you want to set a parameter value based on what someone types into an input box.
It would be something like
Jump.ValuateFromString("50mm")
So you would need to add the "mm" onto the end if your user is only entering...
If you only want to run Measure Inertia once on a part that is in the structure multiple times, check the part for the feature before running the command.
You could do a search for "InertiaVolume.1" inside the part or go after it directly if it is available in the API documentation.
If it is...
Are you talking about loading parts that have publications which feed external references in a part you have loaded?
Based on my experience, external reference paths are not exposed. You also cannot tell if an external reference is connected or not. In some cases you can find the document, but...
It would be easier to help if you said what you want the macro to do and if you had a picture of your specification tree so we can see the structure. Will the tree look the same all the time?
1. The first "element" in the line is a parameter because the line likely has no history. Does the line...
Here's what I got, worked well.
'Paste into Visual Basic
'Open a part
'Second geoset in the Part must contain the points (you can change this)
'Run the macro
'Macro will:
' -Loop through all points
' -Create XYZ parameters under the point
' -Create a formula for XYZ parameters so they equal...
If the middle section can be circular, I woould Look up DMU Fitting Tracks in help. You can create several translations and rotations (tracks) using the compass > edit then put them together into one motion.
If you reference part A into part B, you cannot reference points from part B back into part A...that creates a circular reference...so I am a bit confused on that.
But regardless of that issue...
If you want the annotation to update, you need to have parameters for the XYZ coordinates and...
How are you closing CATIA? If you use the RED X in the upper Right corner, your CATSettings will not be saved. You need to select File>Exit to save CATSettings.
I tried for quite a while in VBA to find:
If an external reference is bad/not connected
The parent of an external reference
From my experience:
Differentiating between a good and bad external reference is not an exposed API...You would likely need CAA to do this
Getting the parent of the...
So you copy the points in and can later change the coordinates of the points that were copied in?
If you want the annotation to update you need to make length parameters that are tied to the coordinates of the points, then attribute link those parameters to your annotation.
You can create...