Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

read-only in session

Status
Not open for further replies.

Arpad_Jacso

Computer
Aug 22, 2019
14
0
0
HU
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
 
Status
Not open for further replies.
Back
Top