필터 지우기
필터 지우기

how to add cusom properties on current project object

조회 수: 3 (최근 30일)
suraj mate
suraj mate 2024년 2월 8일
댓글: Steven Lord 2024년 2월 8일
i have current project open and we have some default properties like
i want to add some properties on this project i have tried addprop method but it will create dynamic property which will erase when i close the project.
so i want to add custom property which i can see even after re-opening the project. howw i can do that..?
  댓글 수: 2
Chunru
Chunru 2024년 2월 8일
You need to edit currentProject class file to add property.
suraj mate
suraj mate 2024년 2월 8일
how can i do that ..?
do you have any refrence to do this

댓글을 달려면 로그인하십시오.

답변 (2개)

Image Analyst
Image Analyst 2024년 2월 8일
Make a function that opens the project and then adds the additional property that you want. Then call that function instead of the other one you were using to open the project (because the other one did not have your custom property).
  댓글 수: 3
Image Analyst
Image Analyst 2024년 2월 8일
Looks like @Steven Lord says it's not possible yet. I suggest you just declare/write your class file such that the desired properties are in there right from the start.
Steven Lord
Steven Lord 2024년 2월 8일
In order to make the new properties persist you'd have to modify the definition of the class. Since the Project object is part of MATLAB and is only included as a p-coded file:
which -all matlab.project.Project
/MATLAB/toolbox/matlab/project/api/+matlab/+project/Project.p % matlab.project.Project constructor
1) it's not possible for users to modify the class and 2) even if it were, I would strongly recommend against it. Installing an update release could cause any such changes you'd made to be overridden. Installing a new release would install the "factory" version of the class, not one with your modifications. If there was a problem with the modified version of the file and you called Technical Support, they likely would ask you to restore the MathWorks version of the file to determine if the modifications were the cause of the problem.

댓글을 달려면 로그인하십시오.


Steven Lord
Steven Lord 2024년 2월 8일
Please contact Technical Support directly using this link and ask them to enter a request to add properties to the Project object to the enhancement database. When you submit your enhancement request, please describe what properties you were hoping to add to the class and how you would use those new properties if they were available, so the developers can consider your use case when evaluating the enhancement request.

카테고리

Help CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by