×
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

Select children of a selected item/hole ( macro )

Select children of a selected item/hole ( macro )

Select children of a selected item/hole ( macro )

(OP)
Let's assume i have a hole , and a macro that i'ts painting this hole the color i want ( i allready made this ) , now i want to propagate the same color at all the matrix, and function linked to this hole.
Can this be done?

Hole.1
Matrix.1

Macro-color-holes.catscript ( i allready have this )

Read hole dimension.
Assign the hole a color related to the dimension.
Look for matrix (children) of this hole.
Assign the same color of the hole.

How can i implement this routine to this code?


Dim sel As Selection
Set sel = productDocument1.Selection
sel.Search "CATPrtSearch.Thread,all"
Set visPropertySet = sel.VisProperties
visPropertySet.SetRealColor 255,255,0,0
sel.Clear


Dim sel As Selection
Set sel = productDocument1.Selection
sel.Search "CATPrtSearch.Thread,all"
Set visPropertySet = sel.VisProperties
visPropertySet.SetRealColor 255,255,0,0
>> SELECT MATRIX OF THIS HOLE AND ASSIGN SAME COLOR.
selection.Clear


Thanks

RE: Select children of a selected item/hole ( macro )

Hi,

Quote (Vector86)

Look for matrix (children) of this hole.

I'm not a native English speaker, so excuse my question.

In the image bellow you have the Parent/Children of a hole. What does it mean for you matrix? Are you looking to color all holes in a part with same diameter with the same color? Can you give more details?

Regards
Fernando

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

RE: Select children of a selected item/hole ( macro )

what do you call Matrix.1 a Pattern? If you can get active body, check all shape until you find a pattern and check patternObject.ItemToCopy if it return your Hole...

BTW You're talking about a Hole, but you search for Threads... not same object in CATIA,and your search won't find hole with thread definition included, but will find thread operation applied to Hole, but not the one in the pattern.

When you do Hole with thread definition and Pattern it will also pattern the threads.

When you do Hole (no thread) or Pocket, then Thread it, make sure you select both the Hole and the Thread for Pattern.

now that you have either threaded Hole or Hole/Pocket + Thread, you get the active body and loop all shape and check thepattern.ItemToCopy.

As I am looking into it as I'm coding right now, I can see limitation here as ItemToCopy will return only the first selected object, so in case of Hole/Pocket + Thread, it will not work for you.

So Methodology would be to use only Threaded Hole and not Hole or Pocket + Thread...

Not sure if ThreadAnalysis API i available, or maybe Parent/Children API...

Good luck


Eric N.
indocti discant et ament meminisse periti

RE: Select children of a selected item/hole ( macro )

ok it will work only if you select the Thread first then the pocket/hole when you do the Pattern... which would be a weird way but not impossible.

Eric N.
indocti discant et ament meminisse periti

RE: Select children of a selected item/hole ( macro )

(OP)
Thanks but probably i'v been misunderstood. The code i pasted is just a parte of a code that is rolling and looking for holes/threads/diameters etc..
So i really don't need this kind of "differentiation" the software will make this for me , i would just like to know if there is a command to call for children.

Once i have the desired hole selected. I need a comand to select it's linked matrix, like the screen i'v posted.

RE: Select children of a selected item/hole ( macro )

easiest way would be like I said, scan all feature in solid until you find Pattern, then look at .ItemToCopy remember the limitation that it will work only if the selected object is the first on the list.

Eric N.
indocti discant et ament meminisse periti

RE: Select children of a selected item/hole ( macro )

(OP)
If .ItemToCopy racall the hole it's fine for me, i will make a try.

RE: Select children of a selected item/hole ( macro )

(OP)
Having the matrix selected and launching the comand .ItemToCopy in the macro i'm not giving me the hole. Wich is the syntax exactly?

UPDATE.

I managed to make this work but further consideration i strictly need something from "holes" to they'r "matrix" is there no command for that?
Like there is for products? ( children )

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