Quantcast
Channel: All Revit API Forum posts
Viewing all 67020 articles
Browse latest View live

Re: How to change a SturcturalConnectionHandlerType

$
0
0

I asked the development team for you.

 


Re: Element created from solid lost material property in family document

$
0
0

First of all, find out how to achieve what you wish manually in the user interface. Then, use RevitLookup and other tools to explore the family document database to see how that is represented in the elements and their properties. Once you have that clarified, start working on your programming task:

 

https://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-ontology.html#3

 

There is a rather a large number of possible ways to define a material on an element:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.24

 

Re: How to change a SturcturalConnectionHandlerType

$
0
0

Thank you for your help, otherwise i could not get any information about this topic.

Re: Element created from solid lost material property in family document

$
0
0

Hi Jeremy,

 

you cannot create a DirectShape in the user interface, so the usual way cannot be gone.

 

 

Rudi

Re: Element created from solid lost material property in family document

$
0
0

Hi,

 

can you set the FreeFormElement's BuiltInParameter.MATERIAL_ID_PARAM?

 

Revitalizer

Re: ExternalEvent

Get room informations from FamilySymbol

$
0
0

Hello,

how can i get the room informations from a FamilySymbol? With a FamilyInstance it works, but not with FamilySymbol:

 

Capture.PNG

 

Thanks

 

Daniel

Re: Get room informations from FamilySymbol

$
0
0

It is because a FamilySymbol does not exist in a room. It is the top level element for a Family that holds the Types, but the FamilyInstance is what is placed in the model and therefore can have room information. 


Re: 2020 Revit Object Model

Re: 2020 Revit Object Model

Re: Export to DWG and automaticaly bind images

$
0
0

So far i've done this:

        public static void Etrans(string desenho,string destination)
        {

            try
            {
                TransmittalFile tf;
                TransmittalOperation to = new TransmittalOperation();
                TransmittalInfo ti = to.getTransmittalInfoInterface();

                System.Windows.MessageBox.Show(desenho);
                to.addDrawingFile(desenho, out tf);

            ti.destinationRoot = destination;

            ti.preserveSubdirs = 0;


            ti.organizedFolder = 0;

            ti.dataLinkRelativePath = 1;
            ti.DGNUnderlayRelativePath = 1;
            ti.DWFUnderlayRelativePath = 1;
            ti.imageRelativePath = 1;
            ti.PDFUnderlayRelativePath = 1;
            ti.xrefRelativePath = 1;

            ti.saveVersion = SaveDwgFormat.eAutoCADR21;

            ti.visualFidelity = 1;

            ti.includeXrefDwg = 1;
            ti.includeUnloadedReferences = 1;
            ti.includeUnloadedXrefDwg = 1;
            ti.includeNestedOverlayXrefDwg = 1;

            ti.BindType = BindType.eBind;

            ti.depathXrefs = 1;

            ti.includeImageFile = 1;
            ti.includeDGNUnderlay = 1;
            ti.includeDWFUnderlay = 1;
            ti.includePDFUnderlay = 1;
            ti.includeDataLinkFile = 1;

            ti.includeFontFile = 1;

            // Reset plotters for layouts in the drawings to None, 
            // and include plot style (CTB/STB) files (0 - False, 1 - True)
            ti.resetPlotter = 0;
            ti.includePlotFile = 0;

            ti.includePhotometricWebFile = 1;
            ti.includeMaterialTextureFile = 1;

            ti.purgeDatabase = 0;

            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(ex.ToString());
            }
            
            try
            {
                //to.createTransmittalPackage();
            }
            catch
            {
                System.Windows.MessageBox.Show("ERRO");
            }
        }

And call it here:

foreach (var f in files)
                    {
                        MessageBox.Show(pathArquivo);
                        if(f.FullName.Contains(".dwg"))
                        {

                            ZiTools.Etrans(f.FullName, pathArquivo);
                        }

But i get this error:

image.png

I've created the interop "TRANSMITTALLib.dll" as indicated here:

https://help.autodesk.com/view/OARX/2019/ENU/?guid=GUID-FF7AD257-9C2A-4A4D-8408-FC5C209DC7E8

Re: What is the best avenue for programming in the family editor?

$
0
0

Thank you Jeremy,

I have created some dynamo graphs but, have run into limitations or just plain don't know how to get from here to there. I started looking at C# and will probably go this route. Will need some training. My VB and Lisp skills are not transferring well at all. It could be the 15 years laps in using them.

 

Re: What is the best avenue for programming in the family editor?

$
0
0

I predict you will learn to love C# and .NET.

 

Programming has come quite a way in the past few decades 🙂

 

Have fun!

 

Re: How to change a SturcturalConnectionHandlerType

$
0
0

Sorry to report their answer:

  

At this moment there is no counterpart for StructuralConnectionHandlerType inside Advance API and there is no method to edit parameters for StructuralConnectionHandlerType. We filed a request for this for future versions, REVIT-152546.
 
At least you know where you are with this now.
 
That said, you can try to access the standard generic Revit element parameters and see what you can do with them, just like you can for any element.
 

Re: Export to DWG and automaticaly bind images

$
0
0

To simplify matters, it ill probably be safest for you to develop your AutoCAD.NET add-in as a stand-alone app first, before trying to run it within a Revit add-in. That way, you eliminate one potential cause for problems. If you have any problems in that scenario, I would suggest raising them in the AutoCAD.NET discussion forum.

 


Re: WinForms or WPF?

$
0
0

This is an old thread but it's still highly ranked on Google so I just wanted to chime in that I went down the WinForms path for about a year and I really regretted it. I would highly recommend that everyone go down the WPF route.

For one, WinForms often have some serious and practically unsolvable scaling issues on high resolution monitors. You can read some more discussion here, and while Inter-Process Communication (IPC) is a good option for fixing this user's existing code base, implementing IPC is way more work than just using WPF to begin with, since WPF apps don't have scaling issues.

Additionally WPF UIs are built in a much more modern way, with XML layout documents, separate style documents, and separate code / logic documents. This is much more similar to how UIs are built on other frameworks (like Android / iOS / macOS  / web development) and will better prepare you for expanding your development knowledge. This separation also tends to produce much cleaner, more flexible, and more reuseable code.

And lastly, because WPF is a more modern framework, I find that it's just far easier to produce apps that actually look good, and that my users actually enjoy opening up. As developers it's easy to focus on the back end data, but if you want to make a tool that people actually use, it needs to have a pleasing UI, and the styling / dynamic binding nature of WPF makes it far far far easier to produce at least halfway modern UXs.

Coordinate Tables

$
0
0

Is there a way to generate x, y, z tables from existing spline reference points in revit?

Re: Change the panel a connector is connected to

$
0
0

Let me answer your questions in reverse;


 wrote:

For many elements, the host can only be set by the constructor, when creating a new element, and not modified later.

 


OK, for now I'll simplify the question to "how do I read the values for the connected panel and circuit number?"


 wrote:

 

Is the panel the host of the device?

 


No, the connector is hosted to a device, like a receptacle.  The connector (and the receptacle) are circuited to the panel via a circuit.  The circuit should contain information including the connected panel name and the circuit number.

 


 wrote:

What is the parameter data type?

 

Revit manages some data types in parameters that do not fit into the int, double, ElementId and string classes supported by the Revit API, and are therefore inaccessible.

 

What does RevitLookup show?


Well, Revit Lookup shows that parameter is associated with the host (the receptacle) and not the actual connector.  It shows it as an Instance Parameter of a "String/Text" type in the "Element.Parameters" collection.   

 

So it seems like I need to read the parameter from the receptacle, and not the connector.  Does that sound like I'm on the right track?


But what happens when a device has more than one connector?  A single parameter can't hold two different panel names or circuit numbers?

 

Re: ExternalEvent

$
0
0

You cannot call ExternalEvent.Create() outside of a valid Revit API context, and a callback from a button click is most definitely not a valid context.

 

What i do is create an instance of the IExternalEventHandler and call ExternalEvent.Create() from the IExternalCommand, or other valid context, and pass them to the viewmodel (or create them in the ViewModel contstructor if you're newing up the ViewModel in the IExternalCommand.  I prefer MVVM, if you do not then pass them to or create them where you're UI logic resides, a Controller, or directly in the Form, or wherever.  Then in your button click callback you pass necessary state info to your IExternalEventHandler and then call Raise().

Re: WinForms or WPF?

$
0
0

Thanks for the very informative reply. I have stuck with Winforms, but your points are all valid. Next time... Dale

Viewing all 67020 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>