×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Creating Parameters Directly under a GeoSet

Creating Parameters Directly under a GeoSet

Creating Parameters Directly under a GeoSet

(OP)
I have a script that creates String Parameters, and then I have to Cut-And-Paste each one into the appropriate GeoSet that holds fastener points of a variety indicated by the Parameter String. Is there a way to create the parameter directly into the GeoSet without the need for the Cut-And-Paste?
This 'Parameter in the GeoSet' is the format that is used by a piece of Riveting software.

RE: Creating Parameters Directly under a GeoSet

cut and paste within parameters creation macro.

CODE --> catscript

Language="VBSCRIPT"

Sub CATMain()

Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part
Set part1 = partDocument1.Part


Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies

Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Add()

hybridBody1.Name = "GENERAL NOTES"


Dim parameters1 As Parameters
Set parameters1 = part1.Parameters

Dim strParam1 As StrParam
Set strParam1 = parameters1.CreateString("", "")

strParam1.Rename "GENERAL TOLERANCES"

strParam1.Value = "ASNA2110"

part1.Update 

Set partDocument1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = partDocument1.Selection

selection1.Clear 

selection1.Add strParam1

selection1.Cut 

Set partDocument1 = CATIA.ActiveDocument

Dim selection2 As Selection
Set selection2 = partDocument1.Selection

selection2.Clear 

selection2.Add hybridBody1

selection2.Paste 

Set partDocument1 = CATIA.ActiveDocument

Dim selection3 As Selection
Set selection3 = partDocument1.Selection

selection3.Clear 

Dim parameters2 As Parameters
Set parameters2 = part1.Parameters

Dim parameterSet1 As ParameterSet
Set parameterSet1 = parameters2.RootParameterSet

selection3.Add parameterSet1

selection3.Delete 

End Sub 

RE: Creating Parameters Directly under a GeoSet

Hi l3obAero. What company do you work for? We do similar things at my company for a variety of applications.

RE: Creating Parameters Directly under a GeoSet

(OP)
Triumph Aerostructures, was the old Vought out of Texas. Working on an Airbus project.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources