in the documentation:
"Creates datums from a multi-domain result feature, one datum is created by object domain.
Note; Available only for a shape design feature as input ( not for datum feature )."
it seems that sketch USED to be acceptable, now it is not... So I created a JOIN of the sketch...
Sub CATMain()
Dim V As Integer
Dim StrWindows As String
Dim DrawingExists As Boolean
DrawingExists = False
Set windows2 = CATIA.Windows
For V = 1 To windows2.Count
StrWindows = windows2.item(V).name
MsgBox windows2.item(V).Parent.name
If InStr(StrWindows, "Drawing") Then...
this functionality exists in Assembly Design Workbench (Tools-Generate CATPart from Product) or in Infrastructure/Product Data Filtering (Product To Part)
this code assumes you have already selected your AxisSystem. I retrieve all the info from this axis system (origo, axis coordinates) and create two lines that will span the plane.
Sub CATMain()
Dim partDocument1 As partDocument
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As part
Set...
Hi Tiago, select the Axis System, and set
part1.InWorkObject=sel.item(1).value
Set CurrentHBody = part1.InWorkObject
that will set the parent geo-set as "Define in Work Object" -- and from here you can navigate your way up to the top, right?...
You really need to post your code. Are you checking the instance? Because that IS a product. Or are you selecting the .catpart (it has only one cog-wheel as icon), one level below the instance.
If your rivet holes are created with a pattern, you can re-use this same pattern in assembly; CATIA has this functionality in Assembly called "Reuse Pattern"
I usually try to
read a file into CATIA,
work on the data,
and then dump out the data into the file in one go.
and not go back and forth throughout the script execution...
yupp, so you will need a VB script and a reaction triggering your curve's update -- both are created from within the Knowledge Advisor Workbench.
In the script definition you just specify the argument: "MyOptim" and in the body you state: MyOptim.run(false)
The reaction which you set up to be...
if you have access to PEO workbench (Product Engineering Optimizer), then you can easily set up an optimization;
you need a real parameter that has a formula calculating the curvature,
and a point on curve (ratio). in the optimization.
the optimized parameter would be the Real parameter, and...
documentation of pycatia seems to be a bit incomplete...
this works on my side...
from pycatia import catia
catia_app = catia()
documents=catia_app.documents
print(documents)
part = documents.item(1).part
spa_workbench = documents.item(1).spa_workbench()
hybrid_bodies = part.hybrid_bodies...
yeah, sorry I was a bit sloppy...
x,y,z and t are real.
trig functions need deg or rad as a unit, that is why I explicitly multiply my real parameter t with the unit (*1deg).
Angle.1 parameter is already defined as [deg]
t runs always from 0 to 1 so the below will draw a helix (circle if z=0)...