Check the Layout of this C# Program

Check the Layout of this C# Program

noushadcmpkl
Contributor Contributor
1,395 Views
5 Replies
Message 1 of 6

Check the Layout of this C# Program

noushadcmpkl
Contributor
Contributor

Dear Community,

 

   I am new to Revit API and C#. I have a code below. I think the classes in the programs is not called/arranged correctly. Kindly help me to call the void PrompForPointCloudSelection in the PCSectionBox : IExternalCommand class.

 

 I think, one who knows how to put a C# code together can help me in this regard!

 

 

Hoping for a solution,

Noushad Khan. C. H.

 

RevitDev SS - 1.png

0 Likes
Accepted solutions (1)
1,396 Views
5 Replies
Replies (5)
Message 2 of 6

Dale.Bartlett
Collaborator
Collaborator

Try:

public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            Result lresResult = Result.Failed;
            UIApplication uiApp = commandData.Application;
            UIDocument uiDoc = uiApp.ActiveUIDocument;

            PointCloudInstance pcInstance = GetMyPointCoud(); // YOU NEED TO ORGANISE THIS

            lresResult = PromptForPointCloudSelection(uiDoc, pcInstance); // NOTE! CHANGE THIS TO RETURN Result.Succeeded IF SUCCESSFUL

            return lresResult;
        }

Dale

 




______________
Yes, I'm Satoshi.
Message 3 of 6

noushadcmpkl
Contributor
Contributor
Thanks Dale for taking your precious time on this post. I tried the above code and I am in the process of generating GetMyPointCloud() method. As I am new to this stuff it might take some time. Hope I finish it soon. 🙂
0 Likes
Message 4 of 6

Dale.Bartlett
Collaborator
Collaborator

Hope it helps. It is tricky getting off the ground but worth the effort. Remember to mark as solution, if indeed it was. Dale




______________
Yes, I'm Satoshi.
Message 5 of 6

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Noushadcmpkl,

 

I would suggest that you first of all work through the Revit API getting started material before asking any furhter questions, especially the DevTV and My First Revit Plugin tutorials:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

 

That is the fastest and most effective way to explain almost everything you need to know and avoid a huge amount of confusion and head scratching on your part.

 

Good luck and have fun getting started with C# and the Revit API!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 6 of 6

noushadcmpkl
Contributor
Contributor

Dear Jeremy,

 

Thanks for your reply.

 

At the time of posting the question I was really a beginner trying to achieve certain results by gathering codes from different sources and putting them together to work, just like most of the programmers do in the beginning.

 

As I came across the tutorial series that you shared, it was highly helpful for me to understand the structure and proper methodology of coding.

 

By the way, your blog posts are awesome!

 

 

Warm Regards,

Khan

 

 

 

0 Likes