Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

multi shaft select and change there revolution angle

Status
Not open for further replies.

Arun_Gopala

New member
Apr 20, 2020
7
US
I am having a part with several shaft features,I am trying to select the shaft angle and chage its angle and loop through all the shaft features in the part.In doing so I am getting an error in "object doesn't support this property or method (objSel.Item(i).FirstAngle) see below teh code.Thanks for your help

Sub CATMain()

Dim objSel As Selection
Set objSel =CATIA.ActiveDocument.Selection
objSel.Search("type=Shaft*,all")

objcount = objSel.count

msgbox objcount

Dim i As Integer

For i = 1 to objSel.Count
dim angle1 as length

set angle1 = objSel.Item(i).FirstAngle

angle1.value=114.0000
Next
End Sub
 
Replies continue below

Recommended for you

you are still in selection object, to get to the item, you need to call objsel.item(i).Value.FirstAngle

regards,
LWolf
 
Dear LWolf,
Yep you are right, I need to call (Value).Thanks for your help.very much appreciate it.

Regards
Arun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top