CATIA vb.net Change axis direction
CATIA vb.net Change axis direction
(OP)
Hello,
I'm creating a macro in visual studio, Vb.net, and in a certain point, I need to change the z axis direction of an axis system.
in vb6 i used like this.
axisSystems1.ZAxisType = catAxisSystemAxisOppositeDirection
in vb.net it doesn't work.
Any idea ?
I'm creating a macro in visual studio, Vb.net, and in a certain point, I need to change the z axis direction of an axis system.
in vb6 i used like this.
axisSystems1.ZAxisType = catAxisSystemAxisOppositeDirection
in vb.net it doesn't work.
Any idea ?
Tiago Figueiredo
Tooling Engineer





RE: CATIA vb.net Change axis direction
Tesak
http://scripts4all.eu/txtoncurve/ - Text along a curve for Catia V5
RE: CATIA vb.net Change axis direction
Any idea how to solve?
Tiago Figueiredo
Tooling Engineer
RE: CATIA vb.net Change axis direction
You have to declare
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA vb.net Change axis direction
Tiago Figueiredo
Tooling Engineer
RE: CATIA vb.net Change axis direction
i have made like object browser says.
Public Const catAxisSystemAxisOppositeDirection As MECMOD.CATAxisSystemAxisType = 2
Tiago Figueiredo
Tooling Engineer
RE: CATIA vb.net Change axis direction
In my web search i found this:
CODE --> Vb
Set oAchs = oPart.AxisSystems.Add() Set oUrsprung = oPart.Parameters.Item("Startpunkt") Set oZ_Richt = oPart.Parameters.Item("Linie-normal") oAchs.OriginType = catAxisSystemOriginByPoint oAchs.XAxisType = catAxisSystemAxisSameDirection oAchs.YAxisType = catAxisSystemAxisSameDirection oAchs.ZAxisType = catAxisSystemAxisSameDirection oAchs.IsCurrent = False oAchs.OriginPoint = oPart.CreateReferenceFromObject(oUrsprung) oAchs.ZAxisDirection = oPart.CreateReferenceFromObject(oZ_Richt)Wich is almost the same that i'm using. I still don't have found my mistake.
In module i have made the publication
Public Const catAxisSystemAxisOppositeDirection As MECMOD.CATAxisSystemAxisType = 2
then in the public sub
i have made this:
CODE --> vb.net
Dim axisSystems1 = selection1.Item(1).Value axisSystems1.Name = "Screw hole direction." & Num_hole axisSystems1.ZAxisDirection = catAxisSystemAxisOppositeDirectionI need help!!!
Tiago Figueiredo
Tooling Engineer
RE: CATIA vb.net Change axis direction
This works in catvba. But I still don't know why don't work in vb.net.
Tiago Figueiredo
Tooling Engineer
RE: CATIA vb.net Change axis direction
CODE --> vb.net
Dim partDocument1 As Document partDocument1 = CATIA.ActiveDocument Dim selection1 As Selection selection1 = partDocument1.Selection selection1.Search("Name=*Absolute' 'Axis' 'System*,all") If selection1.Count = 0 Then Dim part1 As MECMOD.Part part1 = partDocument1.Part Dim axisSystems1 As MECMOD.AxisSystems axisSystems1 = part1.AxisSystems Dim axisSystem1 As MECMOD.AxisSystem axisSystem1 = axisSystems1.Add() Dim arrayOfVariantOfDouble1(2) arrayOfVariantOfDouble1(0) = 0.0 arrayOfVariantOfDouble1(1) = 0.0 arrayOfVariantOfDouble1(2) = 0.0 axisSystem1.PutOrigin(arrayOfVariantOfDouble1) axisSystem1.XAxisType = catAxisSystemAxisByCoordinates Dim arrayOfVariantOfDouble2(2) arrayOfVariantOfDouble2(0) = 1.0 arrayOfVariantOfDouble2(1) = 0.0 arrayOfVariantOfDouble2(2) = 0.0 axisSystem1.PutXAxis(arrayOfVariantOfDouble2) axisSystem1.YAxisType = catAxisSystemAxisByCoordinates Dim arrayOfVariantOfDouble3(2) arrayOfVariantOfDouble3(0) = 0.0 arrayOfVariantOfDouble3(1) = 1.0 arrayOfVariantOfDouble3(2) = 0.0 axisSystem1.PutYAxis(arrayOfVariantOfDouble3) axisSystem1.ZAxisType = catAxisSystemAxisByCoordinates Dim arrayOfVariantOfDouble4(2) arrayOfVariantOfDouble4(0) = 0.0 arrayOfVariantOfDouble4(1) = 0.0 arrayOfVariantOfDouble4(2) = 1.0 axisSystem1.PutZAxis(arrayOfVariantOfDouble4) part1.UpdateObject(axisSystem1) axisSystem1.IsCurrent = True part1.Update()Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: CATIA vb.net Change axis direction
Yes, i'm having some problems with it. I still don't understand why, but definitely, there is something wrong with my code. I was focus in changing direction of the Z axis, with no results. Then I remember to create a new axis system, and no results as well. So in cooperation with a member of this forum, I decided to compile the code to a new project in visual studio, just to focus on my problem. With this new code it works real fine. So definitly there is something wrong with my code. So I will start it from scratch.
Tiago Figueiredo
Tooling Engineer
RE: CATIA vb.net Change axis direction
When i made the search to find my axis system. I used the search method because isn't inserted in axis system colector.
CODE --> vb.net
selection1.Search("Name='Screw hole direction' & CATPrtSearch.AxisSystem,sel")the name of the axis it was wrong.
Screw hole direction
what a stupid thing....
I never suspected that the search was wrong, and never debug it until now...
Thanks by your help
Tiago Figueiredo
Tooling Engineer