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.
thank you...
regards-appvid
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
You mean something like in CAAGsiCreatePtLnAndConvertToDatum.CATScript which can be found in v5automation.chm file ?
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
RE: How to make datum and No keep
I want feature to datum, and with no keep mode on. please see image..
thanks
RE: How to make datum and No keep
Hello I'm trying to use this to make isolte and delete parent (keep no mode)
CODE --> code
but whats wrong with Set hybridShapePointExplicit2 = hybridShapeFactory1.AddNewPointDatum(reference3)
thanks
appvid
RE: How to make datum and No keep
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
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
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
RE: How to make datum and No keep
CODE --> code
why cheking ref2 (line 2) if you use ref3 (line 6 & 11 ) after?
indocti discant et ament meminisse periti
RE: How to make datum and No keep
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