AutoCAD Plant 3D Forum
Welcome to Autodesk’s AutoCAD Plant 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Plant 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Line Lock in Batch

7 REPLIES 7
Reply
Message 1 of 8
Pranjal.Anand
570 Views, 7 Replies

Line Lock in Batch

Hi, 

I am currently working on Plant 3D 2018 on a domestic project, I have been asked to lock about 100+ lines which have to be issued. Is there a batch process to lock all the lines at once?

7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Pranjal.Anand

Quickselet

##- Please type your reply above this line -#
David Cruze
Message 3 of 8
Pranjal.Anand
in reply to: Anonymous

Hi David,
The command you suggested doesn't perform the trick. I need to lock the lines in complete project, which have been used to make the design in Plant 3D.
Message 4 of 8
jabowabo
in reply to: Pranjal.Anand

You can lock them on the Isometric DWG tab:

Capture.PNG

Message 5 of 8
Pranjal.Anand
in reply to: jabowabo

Hi Jason, 

Thank you for your reply. Actually I wanted to know; Say for instance you have 200 lines scattered in the list in Isometrics tab and you want to lock them. So, instead of manually looking for them, is there any batch/automated process utilizing which we can just input the list of lines to be locked and the system locks them?

Message 6 of 8
jabowabo
in reply to: Pranjal.Anand

AFAIK, only through the API:

        public static void LineGroupLock(List<string> lineGroupTags, bool lockLineGroup)
        {
            Document doc = MiscTools.GetActiveDoc(); if (doc == null) return;
            Editor ed = doc.Editor;
            Database db = doc.Database;

            PlantProject currentProj = PlantApp.CurrentProject;
            PipingProject pipeProj = (PipingProject)currentProj.ProjectParts["Piping"];
            DataLinksManager dlm = pipeProj.DataLinksManager;
            DataLinksManager3d dlm3d = pipeProj.DataLinksManager3d;
            PnPDatabase pnpDB = dlm.GetPnPDatabase();
            PnPTable pnpLGTbl = pnpDB.Tables["P3dLineGroup"];

            foreach (string lineGroupTag in lineGroupTags)
            {
                try
                {
                    // Get rows where the LineGroup "Number" column equals 'lineNumTag'.
                    string where = "\"Tag\"='" + lineGroupTag + "'";
                    PnPRow[] lgRows = pnpLGTbl.Select(where);
                    foreach (PnPRow lgRow in lgRows)
                    {
                        int lgRowId = lgRow.RowId;
                        dlm3d.LockLineGroup(lgRowId, lockLineGroup, true);
                    }
                }
                catch
                {
                    ed.WriteMessage("\nError: Cannot lock/unlock linegroup " + lineGroupTag);
                }
            }
            dlm.AcceptChanges();
        }
Message 7 of 8
Pranjal.Anand
in reply to: jabowabo

Hi Jason, Could you explain, how to apply this in the actual project in detail?

Message 8 of 8
jabowabo
in reply to: Pranjal.Anand

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

Post to forums  

Technology Administrators


AutoCAD Beta