.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Renumbering Sheet set at the specific location.

0 REPLIES 0
Reply
Message 1 of 1
trithuongle
99 Views, 0 Replies

Renumbering Sheet set at the specific location.

Hello everybody, I have a question.

I'm creating a small command to renumber a sheet set automatically.

The idea is [input command => input start number(in the below sample is 2) => enter].

I can do this successfully with the entire sheet set (including sheet , subfolder) like below image.

trithuongle_0-1696690457149.png

But now i don't know how to renumber the sheet set from the specific location by selecting a sheet in advance like the below image.

trithuongle_1-1696690614758.png

I also tried the below codes to get sheet set's selection set, but it always return 0 .

                ////Find current selected component location:
                AcSmSheetSelSets sheetSelSets = sSet.GetSheetSelSets();
                if (sheetSelSets == null)
                {
                    ed.WriteMessage("\nCannot get sheet selection set!");
                    return;
                }

                //IAcSmEnumComponent ssEnumCom;
                IAcSmEnumSheetSelSet ssEnumSelSet = sheetSelSets.GetEnumerator();
                if (ssEnumSelSet == null)
                {
                    ed.WriteMessage("\nCannot get enum for Sheet selection set!");
                    return;
                }

                int testCount = 0;

                AcSmSheetSelSet ssSelSet = null;
                ssSelSet = ssEnumSelSet.Next();
                while (ssSelSet != null)
                {
                    //ed.WriteMessage($"\nOwner: {ssSelSet.GetOwner()}");
                    //ssSelSet = null;
                    testCount += 1;
                    ssSelSet = null;
                    ssSelSet = ssEnumSelSet.Next();
                }

                ed.WriteMessage($"\nTest count : {testCount}");

Does anyone know the solution for this?

Thanks in advance!

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report