Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AngleConstraint, DirectionThreeReversed

4 REPLIES 4
Reply
Message 1 of 5
stuartmp
410 Views, 4 Replies

AngleConstraint, DirectionThreeReversed

Hi All,

 

I am writing a macro to add an AngleConstraint to my assembly that specifies the third axis for rotation.

I am creating the constraint based off an existing constraint that also uses the third axis for rotation.

 

'basically copying the constraint from a pickedObject to a new part

 

The macro works fine, however if the third axis is flipped from the default in the originally pickedobjec.

When the new AngleConstraint is created the 'ReferenceVectorEntity' used to position the part is not flipped
 and there does not appear to be a property to change it.

 

 

below is a small snippet of my code to give an idea of my macro

 

My question is, Is there a way to flip the ReferenceVectorEntity?

 

 

Dim ReferenceVector As Variant

Set ReferenceVector = pickedObjectConstraint.ReferenceVectorEntity

 

' Create the Angle constraint between the parts.
    Dim oConstraint As AngleConstraint
    Set oConstraint = oAsmCompDef.Constraints.AddAngleConstraint(oBrepEnt1, oBrepEnt2, pickedObjectConstraint.Angle.Expression, pickedObjectConstraint.SolutionType, ReferenceVector)

 

Thanks

 

Stuart


   

4 REPLIES 4
Message 2 of 5
adam.nagy
in reply to: stuartmp

Hi Stuart,

 

There does not seem to be such a property in the UI either. If you want to have a flipped effect then just set the angle to a negative value.

 

Cheers, 



Adam Nagy
Autodesk Platform Services
Message 3 of 5
stuartmp
in reply to: stuartmp

Thanks for the response.

I have found that it is possible to change the direction using the UI. Just click on the 3 selection and the wheel your center button on your mouse.


However this is not the solution I am looking for. I need to do it programmatically.

I can see that the Api does not provided a property that shows weather the direction of the third selection is reversed.

What I can see it that once the new angular constraint is created the start and endpoint of the reference entity vector are reversed to the original.

So I think I could use this to create a new reference entity vector.

I have tried to flip the vector but have not had any luck.

Maybe someone could help out or provide another solution.

Message 4 of 5
Carthik_Babu
in reply to: stuartmp

Do check out the below forum link...hope it will be useful
http://forums.autodesk.com/t5/Inventor-Customization/Ilogic-to-handle-Angle-imate-Constraint/m-p/438...
Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 5 of 5
adam.nagy
in reply to: stuartmp

Hi Stuart,

 

Thanks for pointing that out. Also if I hover above an edge long enough then I can select the opposite direction.

 

Best thing to debug things like these is: http://adndevblog.typepad.com/manufacturing/2013/10/discover-object-model.html

If you create two AngleConstraints using the same edges for EntityTwo and ReferenceVectorEntity, but using reverse direction then you can see what's different between those two constraints.

You'll find that both EntityTwo and ReferenceVectorEntity are the same for the two constraints, so those properties cannot contain the direction information. For EntityOne and EntityTwo there are hidden, read-only properties showing if they are reversed: DirectionOneReversed and DirectionTwoReversed, but there is no such property for ReferenceVectorEntity.

 

I logged a wish-list in our system for exposing the necessary properties and ability to create AngleConstraint with reversed directions: id 1510611 

 

Cheers,



Adam Nagy
Autodesk Platform Services

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report