Is it possible to draw lines on a form within the Revit Macro? VB.net
|
Is it possible to draw lines on a form within the Revit Macro? VB.net
Can you explain further? Do you mean a User Form in .Net? What is the significance of drawing 2D lines on a user form when you can do that without Revit?
Example: I want to create a form that would show a baseplate with bolts. I would like to be able to draw the plate and change the dimensions or number and location of the anchor bolts and update the drawing dynamically on the form. When the user has made all of the changes and sees that it is exactly what he wants then he can then choose to apply the changes. This is different than just filling out a group of text boxes with a generic picture that may or may not represent what the use wanted. I don't know if this explains my concept. I have done this in the past with VB or C# as stand alone programs for engineers, but I have not tried this within Revit macros.
Thanks for the explanation. It is very clear now. I believe you should be able to achieve the same thing in Revit Macro. Actually Revit Macro is using C# and VB but in SharpDevelop IDE, similar to Visual Studio IDE but its open source. Much like Visual Studio, it has the same User Forms and .Net Assemblies. While running Revit, do the following:
1. Go to Manage ribbon menu and choose the "Macro Manager".
2. Create a Module.
3. Create a Macro within the module.
4. Click Edit to open the SharpDevelop IDE and start editing.
Since you're familiar with VB and C#, most likely in Visual Studio or similar, it should be an easy ride for you. It's easy to find help for SharpDevelop as well.
I presume you need some sort of dynamic drafting on a form, other wise you could use images and a picture box.
Doing this in vb would be a lot more difficult as there is not much source code to work from vb in a control. I think I saw something on planetsourcecode.com recently about drawing lines in a picture box if you want dynamic. That's always my first source of code because it is very specific and rarely ventures far from that.
You could slam a lot of images in a picture box and simply turn off the ones you don't want to be visible would be easiest.