Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-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
Joined
Aug 22, 2019
Messages
14
Location
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.

Part and Inventory Search

Sponsor

Back
Top