Arpad_Jacso
Computer
- Aug 22, 2019
- 14
Hi,
After I run a instantiate from powercopy macro I cannot save the model beacuse it says "This item is read-only". I checked in the file system and it seems it is read-only only in the catia session.
The SaveAs would help, but I would like to save it in the original location with the same name. Do you know any solution to unlock the file in session through macro?
Here is the instantiate part from the macro:
selection1.Clear
selection1.Search "CATGmoSearch.Point,all"
Dim factory As InstanceFactory
Set factory = part1.GetCustomerFactory("InstanceFactory")
factory.BeginInstanceFactory "PowerCopy.1", "C:\Data\160504_H.CATPart"
Unr = selection1.Count - ooParm.Value + 1
For i = 3 To Unr
factory.BeginInstantiate
Dim FirstHole As Object
Set FirstHole = part1.FindObjectByName("Join.2")
Dim Support As Object
Set Support = part1.FindObjectByName(selection1.Item(i).Value.name)
factory.PutInputData "Join.2", FirstHole
factory.PutInputData "Point.1", Support
Dim Instance As ShapeInstance
Set Instance = factory.Instantiate
factory.EndInstantiate
Next
factory.EndInstanceFactory
part1.Update
After I run a instantiate from powercopy macro I cannot save the model beacuse it says "This item is read-only". I checked in the file system and it seems it is read-only only in the catia session.
The SaveAs would help, but I would like to save it in the original location with the same name. Do you know any solution to unlock the file in session through macro?
Here is the instantiate part from the macro:
selection1.Clear
selection1.Search "CATGmoSearch.Point,all"
Dim factory As InstanceFactory
Set factory = part1.GetCustomerFactory("InstanceFactory")
factory.BeginInstanceFactory "PowerCopy.1", "C:\Data\160504_H.CATPart"
Unr = selection1.Count - ooParm.Value + 1
For i = 3 To Unr
factory.BeginInstantiate
Dim FirstHole As Object
Set FirstHole = part1.FindObjectByName("Join.2")
Dim Support As Object
Set Support = part1.FindObjectByName(selection1.Item(i).Value.name)
factory.PutInputData "Join.2", FirstHole
factory.PutInputData "Point.1", Support
Dim Instance As ShapeInstance
Set Instance = factory.Instantiate
factory.EndInstantiate
Next
factory.EndInstanceFactory
part1.Update