Welcome to the COE Discussion Forum! 

 

To participate in the discussion forum, you must be logged in to the website.  If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.

If you are new to the COE Discussion Forum and would like to participate, please register.


Forum Highlight: CATIA V6

 

Get Answers to Your V6 Questions
Dassault Systèmes answers user questions about CATIA V6.  Discuss these answers and propose new questions with end users from around the world in the CATIA V6 Forum.

COE DISCUSSION FORUM
Subject: Positioning an Axis System in KWA

You are not authorized to post a reply.   
Author Messages
COE-FORUM-USER

24 Apr 2006 03:53 AM
Hi folks

Im trying to reposition an axis system with a Reaction. The axis system (call it MyAxisSystem) already exists in the tree.

Can anyon see whats wrong with the following code:

MyAxisSystem.SetAttributeReal("Origin\X",100mm)
MyAxisSystem.SetAttributeReal("Origin\Y",200mm)
MyAxisSystem.SetAttributeReal("Origin\Z",300mm)

The attributes "Origin\X", "Origin\Y", "Origin\Z", exist according to the parameters explorer, and indeed I can drive them by individual formulas, but when trying it with a reaction there is no effect. Any ideas??? I'm on R14 SP5.

Cheers
Jase
CLIFFJOHNSON


24 Apr 2006 07:51 AM
Looks like you are confusing KWE and KWA languages.
Reactions use the knowledge advisor language.
SetAttributeReal is a knowledge expert rule language element.

Try this in your reaction:


`Axis System.1\Origin\X` = 100mm
`Axis System.1\Origin\Y` = 200mm
`Axis System.1\Origin\Z` = 300mm
COE-FORUM-USER

24 Apr 2006 09:28 AM
errr...nope, the Set/Get/Has Attribute array of functions are actually available from the KWA dictionary (under Object in the bottom left hand pane). You'll see them if your editing a reaction, but not for a Rule. Well.....At least in R14 it is like this.

Im tryna automate things (Ive got 8000 of the bastards to position on a field of points), so I wanted to avoid explicitly calling the `Axis System.1\Origin\X`parameters for each axis system (caus that would make a rule with 24000 lines).

In the example i gave, "MyAxisSystem" comes form a list. Normally it works for other objects.

e.g., the following could be looped to quickly position a heap of points:

MyList=SomeFeature.Query("Point", "")
p=MyList.GetItem(i)
p.SetAttribute("X", someValue)
p.SetAttribute("Y", someValue)
p.SetAttribute("Z", someValue)

or the slow way (repeated explicitly for each point):
`SomeFeature\Point.786\X`=someValue
`SomeFeature\Point.786\Y`=someValue
`SomeFeature\Point.786\Z`=someValue

I have the feeling the name for the origin components could just be something different like pos1 pos2 pos3 etc instead of Origin\X, Origin\Y, Origin\Z, but as usual isn't documented.
CLIFFJOHNSON


24 Apr 2006 12:36 PM
Ok I get it.

I don't think you will find the attributes you are looking for. If you use the Knowledge Expert object browser and look at the AxisSystem object there are no attributes for OX,OY,OZ etc. wheras for GSMPointCoord there are attributes for X,Y,Z.

However, one way to solve your problem is to call a vbscript with arguments from your reaction and change the axis systems in the vbscript:

In your reaction:


let myAxisSyss(List)
let myAxis(AxisSystem)
myAxisSyss = thePart.Query("AxisSystem","")
for myAxis inside myAxisSyss
{
`Relations\VB Scripts\TranslateAxisSys` .Run(myAxis,10,10,10)
}


vb with argument contents:

Sub main (anAxis,dx,dy,dz)
Dim csOrigin(2)
anAxis.GetOrigin csOrigin
csOrigin(0) = csOrigin(0) + dx
csOrigin(1) = csOrigin(1) + dy
csOrigin(2) = csOrigin(2) + dz
anAxis.PutOrigin csOrigin

End Sub

COE-FORUM-USER

26 Apr 2006 10:06 AM
Cliff, your a bloody legend mate - that worked perfectly. Thanks.

Note to self: Use KWE dictionary more often even when writing in KWA. (R14)
IPHILLIPS

26 Apr 2006 03:13 PM
Why do you have to position 8000 axis systems?

Ian Phillips. FORCEFIVE AG, Munich, Germany
You are not authorized to post a reply.
Forums > COE Forums > KBE > Positioning an Axis System in KWA



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)