×
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

How to make datum and No keep

How to make datum and No keep

How to make datum and No keep

(OP)
Hello

I wrote this script that mirros all features in all geometric sets. Now I want to add Make datum, No keep mode to this.

CODE --> code

Sub CATMain()

Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part
Set part1 = partDocument1.Part

Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies

Dim hybridShapeFactory1 As HybridShapeFactory
Set hybridShapeFactory1 = part1.HybridShapeFactory

Dim hybridBody1 As HybridBody

Dim originElements1 As OriginElements
Set originElements1 = part1.OriginElements

Dim hybridShapePlaneExplicit1 As HybridShapePlaneExplicit
Set hybridShapePlaneExplicit1 = originElements1.PlaneZX

Dim referenceplane As Reference
Set referenceplane = part1.CreateReferenceFromObject(hybridShapePlaneExplicit1)


Dim i, j As Integer '========================================================================
For i = 1 To hybridBodies1.Count

Set hybridBody1 = hybridBodies1.Item(i)

Dim HybridShapes1 As HybridShapes
Dim HybridShape1 As HybridShape

For j = 1 To hybridBody1.HybridShapes.Count

Set HybridShapes1 = hybridBody1.HybridShapes

Set HybridShape1 = HybridShapes1.Item(j)

MsgBox HybridShape1.Name

Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromObject(HybridShape1)

Dim hybridShapeSymmetry1 As HybridShapeSymmetry
Set hybridShapeSymmetry1 = hybridShapeFactory1.AddNewSymmetry(reference1, referenceplane)

hybridBody1.AppendHybridShape hybridShapeSymmetry1
 " here I WANT TO ADD CODE THAT MAKES DATUM AND NO KEEP MODE" --- Are there any techniques

Next

Next

part1.UpdateObject hybridBody1 

thank you...

regards-appvid

RE: How to make datum and No keep

(OP)

Hello I'm trying to use this to make isolte and delete parent (keep no mode)

CODE --> code

Dim geotype As Integer
geotype = hybridShapeFactory1.GetGeometricalFeatureType(reference2)

If geotype = 1 Then
Dim hybridShapePointExplicit2 As HybridShapePointExplicit
Set hybridShapePointExplicit2 = hybridShapeFactory1.AddNewPointDatum(reference3)

hybridBody1.AppendHybridShape hybridShapePointExplicit2

part1.InWorkObject = hybridShapePointExplicit2
hybridShapeFactory1.DeleteObjectForDatum reference3 


but whats wrong with Set hybridShapePointExplicit2 = hybridShapeFactory1.AddNewPointDatum(reference3)

thanks
appvid

RE: How to make datum and No keep

Hi,

I saw the post on the German forum and I would say that still the best approach is to follow what I've wrote here

In other words, I wouldn't create everything in the same original part, then isolate and delete original features and save as another part number.

Unfortunately, this week I have a lot of things to finish before going in vacation, so I don't have time to take a closer look on the code and modify it, maybe you will get some help from someone else.

Regards
Fernando

https://picasaweb.google.com/102257836106335725208

RE: How to make datum and No keep

(OP)
Hello Fernando,

Yes I posted my full script in the German forum. I will go through your chm file again to find what I need.

When I copy from my master file to LH side file and mirror then the line,curve,surface graphical properties will be lost. Iam looking to keep same proparties/colors even after mirror action.

I may have to see some options with visproparties.

regards
appvid(var)



RE: How to make datum and No keep

CODE --> code

Dim geotype As Integer
geotype = hybridShapeFactory1.GetGeometricalFeatureType(reference2)

If geotype = 1 Then
Dim hybridShapePointExplicit2 As HybridShapePointExplicit
Set hybridShapePointExplicit2 = hybridShapeFactory1.AddNewPointDatum(reference3)

hybridBody1.AppendHybridShape hybridShapePointExplicit2

part1.InWorkObject = hybridShapePointExplicit2
hybridShapeFactory1.DeleteObjectForDatum reference3 

why cheking ref2 (line 2) if you use ref3 (line 6 & 11 ) after?

Eric N.
indocti discant et ament meminisse periti

RE: How to make datum and No keep

(OP)
Hello , Here I am checking type of parent geometry (curve, line, circle).

if geotype was a point my above script suppose to work
or
Based on geotype return value, it would be hybridShapePointExplicit2, or hybridShapecurveExplicit2, or hybridShapelinetExplicit2 etc

I shall post my entire script so that you will understand better

thnaks

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