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

Re: Pushbutton with no text

$
0
0

Jessh my eyes skipped right over that, thanks for the heads up!


Resizing piping system elements

$
0
0

Hi everyone.

The problem

I'm currently developing piping system sizing tool using Revit API (C#) but have problems with sizing of fittings. My current approach to piping system sizing is:

Transaction start:
    Resize all pipes
    Recreate tees: delete old tees and insert new ones using RevitDocument.Create.NewTeeFitting(Connector_1, Connector_2, Connector_T);
    Recreate elbows: delete old elbows and insert new ones using RevitDocument.Create.NewElbowFitting(Connector_1, Connector_2);
Transaction commit.

As you can see I'm trying to delete old fitting and everything in between with pipe and create a new one. All parameters used in New<Fitting type>Fitting methods are correct (of that I'm sure, I've checked everything many times). The problem is that Revit throws exception Autodesk.Revit.Exceptions InvalidOperationException without any additional explanation. But when I try to connect pipes manually using Revit UI, everything works fine.

Questions

  1. Is there reliable way of piping system sizing than does not break (disconnect) system and changes fittings sizes regardless of user's routing preferences?
  2. Is there any other approach to reliably system sizing if system meets some requirements (for example with using of specified fittings families)?

What i've allready tried

I've allready tried to change fitting's connector size regarding to sizes of connected element's connectors sizes but I had problem that I wrote about in my previous post https://forums.autodesk.com/t5/revit-api-forum/duct-fittings-connectors-width-and-height-depending-on-position/m-p/8515059#M36097 .

 

Thank you.

Re: Ceilings Revit looks different in Navisworks.

$
0
0

Unfortunately, this is not the best place to ask such a question.

 

Please note that this discussion forum is dedicated to programming Revit using the Revit API.

 

Therefore, you cannot expect an answer to a question such as yours relating to installation, product usage or end user support issues here.

 

You should try one of the non-API Revit product support discussion forums instead for that:

 

https://forums.autodesk.com/t5/revit-api-forum/this-forum-is-for-revit-api-programming-questions-not-for/td-p/5607765

 

The people there are much better equipped to answer your question than us programming nerds.

 

I hope this clarifies.

 

Thank you for your cooperation and understanding.

 

Best regards,

 

Jeremy

 

Re: Insert a (face)Family

$
0
0

First of all, the NewFamilyInstance method provides a number of different overloads:

 

https://www.revitapidocs.com/2020/0c0d640b-7810-55e4-3c5e-cd295dede87b.htm

 

You need to select the right one. That is not always trivial:

 

http://thebuildingcoder.typepad.com/blog/2011/01/newfamilyinstance-overloads.html

 

All of that seems to be correct in your code.

 

However, you are casting the geometry object retrieved from the element geometry property directly to a face.

 

I doubt that will work. There may well be several objects in there. Have you looked in the debugger to ensure that that is the indeed a face at all, and not a null object? If it is a null object, as I suspect, that would explain the error message you see. Even if it is not null, chances are that it is not the face you really want. If you check the reference returned by the pick method, it will also give you precise information about the pick point and geometric subelement. You can use those to identify the picked face when you traverse the entire contents of the element geometry.

 

 

Re: Always show the same button on SplitButton

$
0
0

Dear Rikard,

 

Thank you for your nice query.

 

Yes. That is in fact very easy to achieve.

 

I show you how in my HoloLens Escape Path Waypoint JSON Exporter:

 

https://thebuildingcoder.typepad.com/blog/2016/09/hololens-escape-path-waypoint-json-exporter.html

 

The add-in displays the following ribbon panel:

 

hololens_exit_path_ribbon_panel.pngExportWaypointsJson ribbon panel

     

You can either click the main button, which is always displayed at the top as the current option, to trigger the main command, or drop down the rest of the stacked button contents to display the option button:

  

hololens_exit_path_ribbon_buttons.pngExportWaypointsJson main command and settings buttons

   

You can grab the entire Visual Studio solution and project from the ExportWaypointsJson GitHub repository:

 

https://github.com/jeremytammik/ExportWaypointsJson

 

I hope this helps.

 

Best regards,

 

Jeremy

 

Re: Revit 2020.1 plugin .bundle recognition problem

$
0
0

Have you submitted this add-in of yours to the Autodesk Revit AppStore?

  

If so, I suggest you contact them for help:

 

  • app.store.response.team@autodesk.com

 

They are generally extremely helpful and prompt to respond.

  

Re: API Request = Coloring scheme, access to RGB colors

$
0
0

So sad.

Thousands of rooms are waiting to be painted beautifully.But there is no one to bring a leter to the Revit developers' bunker, under the desert in Texas.Perhaps for 5 years our ticket have not been delivered.
 

Re: Revit 2020.1 plugin .bundle recognition problem

$
0
0

Thanks Jeremy, Addin at this stage is not intended to be public. I use bundle format only as most suitable way for in house distribution (there is also some Navisworks plugin in the same bundle and also versions compatible with 2018 series of products). So addin is not to be published via app store. Probably sometimes later.


Re: Revit 2020.1 plugin .bundle recognition problem

$
0
0

I found the reason.🙂

 

Problem were actually in PackageContents.xml:

This doesn't work:

<?xml version="1.0" encoding="utf-8"?><ApplicationPackage 
  SchemaVersion="1.0" 
  AutodeskProduct="Revit"
  AppVersion="0.0.1"
  Author="####"
  Name="####"
  Description="####"
  ProductCode="1FBE5107-799B-####-801A-45DD55143260"
  UpgradeCode="5F645CC5-0758-###-BDB1-2934259B0E30"><CompanyDetails Name="######" Email="##########"/><Components Description="R2019/R2020 parts"><RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2019" SeriesMax="R2020"/><ComponentEntry AppName="ExportTraces" ModuleName="./Contents/2019/R2019/CTExporterImporter.addin"/><ComponentEntry AppName="TracesManipulator" ModuleName="./Contents/2019/R2019/TracesManipulator.addin" /></Components></ApplicationPackage>

But if I change contents to the following, it works:

<?xml version="1.0" encoding="utf-8"?><ApplicationPackage 
  SchemaVersion="1.0" 
  AutodeskProduct="Revit"
  AppVersion="0.0.1"
  Author="#####"
  Name="####"
  Description="####"
  ProductCode="1FBE5107-799B-####-801A-45DD55143260"
  UpgradeCode="5F645CC5-0758-####-BDB1-2934259B0E30"><CompanyDetails Name="####" Email="####"/><Components Description="R2019 parts"><RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2019" SeriesMax="R2019"/><ComponentEntry AppName="ExportTraces" ModuleName="./Contents/2019/R2019/CTExporterImporter.addin"/><ComponentEntry AppName="TracesManipulator" ModuleName="./Contents/2019/R2019/TracesManipulator.addin" /></Components><Components Description="R2020 parts"><RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2020" SeriesMax="R2020"/><ComponentEntry AppName="ExportTraces" ModuleName="./Contents/2019/R2019/CTExporterImporter.addin"/><ComponentEntry AppName="TracesManipulator" ModuleName="./Contents/2019/R2019/TracesManipulator.addin" /></Components></ApplicationPackage>

As you can see, the only difference is, that in second case RuntimeRequirements explicitly states only one series of products but ComponentEntry entries refer to exactly the same files.

 

This functionality of SeriesMax attribute is not according to description given here if that description is valid also for Revit and not only for Autocad series of products.

 

Re: Flip Pipe Fitting

$
0
0

When I used RevitLookup (which is a very helpful too, by the way!), it showed the the HandOrientation of the fitting went from (1,0,0) to (-1,0,0) when I used the UI Control, but the CanFlipHand property is false. Is there a way to work around the read only nature of the HandOrientation property and manipulate it?

Re: Revit 2020.1 plugin .bundle recognition problem

$
0
0

Wow. Congratulations on discovering that!

 

Thank you very much for your research, persistence, and sharing this important piece of knowledge!

 

Re: CreateViaOffset(CurveLoop original,IList offsetDists,XYZ norma

Re: Keeping IUpdater Implementations from Triggering One Another

$
0
0

Sean, thank you, this sounds like the exact thing I'm after, but that doesn't help the fact that I don't know enough to go about actually implementing it based on your description. Would you mind doing me and the other novices who might read this a favor and elucidate a bit more with (pseudo-)code and where it belongs in order to accomplish what you're describing?

bug program

$
0
0

Every time i try to open my refit file a screen pops up with said that a problem caused by the program made refit shut down and then it gives me the option te either close te program completely or debug the program. has anyone had this problem.

I could really use your help. 

I need to hand in my project next week.

Vertically Compound Wall - Adding Splits and Layers

$
0
0

Hi,

 

I need to write code to vertically cut the layers of a wall, as shown in the video below:

https://www.youtube.com/watch?v=TRjB9sylTb4

 

I found in the API documentation the Autodesk.Revit.DB.CompoundStructure.SplitRegion () method, but I don't quite understand how I can use it.

 

I looked for code examples on how to use this method, but didn't find it.

 

Any Suggestions?


Re: Keeping IUpdater Implementations from Triggering One Another

$
0
0

Sorry , I wasn't at my computer when I initially responded, so see the code snips below.

 

1. This is how I disable then enable the updaters from other classes when I want to skip whatever they are doing.

 

App.DisableUpdaters(App.ControlID.application, "sheets");
    //Do what needs to ignore the updater
App.EnableUpdaters(App.ControlID.application, "sheets");

 

2. Here is what the code in 'App' looks to enable them.

internal static Result EnableUpdaters(UIControlledApplication application, string name)
        {
            try
            {
                if (name == "view" || name == "all")
                {
                    Updaters.ViewUpdater viewUpdater = new Updaters.ViewUpdater(application.ActiveAddInId);
                    UpdaterRegistry.EnableUpdater(viewUpdater.GetUpdaterId());
                }

                if (name == "grid" || name == "all")
                {
                    Updaters.GridUpdater gridUpdater = new Updaters.GridUpdater(application.ActiveAddInId);
                    UpdaterRegistry.EnableUpdater(gridUpdater.GetUpdaterId());
                }

                if (name == "sheets" || name == "all")
                {
                    Updaters.ViewSheetUpdater sheetUpdater = new Updaters.ViewSheetUpdater(application.ActiveAddInId);
                    UpdaterRegistry.EnableUpdater(sheetUpdater.GetUpdaterId());
                }

                if (name == "doors" || name == "all")
                {
                    Updaters.DoorRatingUpdater doorRatingUpdater = new Updaters.DoorRatingUpdater(application.ActiveAddInId);
                    UpdaterRegistry.EnableUpdater(doorRatingUpdater.GetUpdaterId());
                }

                if (name == "walls" || name == "all")
                {
                    Updaters.WallRatingUpdater wallRatingUpdater = new Updaters.WallRatingUpdater(application.ActiveAddInId);
                    UpdaterRegistry.EnableUpdater(wallRatingUpdater.GetUpdaterId());
                }

                if (name == "rooms" || name == "all")
                {
                    Updaters.RoomOccupantUpdater roomUpdater = new Updaters.RoomOccupantUpdater(application.ActiveAddInId);
                    UpdaterRegistry.EnableUpdater(roomUpdater.GetUpdaterId());
                }

                return Result.Succeeded;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return Result.Failed;
            }
        }

 

3. Very similar to disable them.

internal static Result DisableUpdaters(UIControlledApplication application, string name)
        {
            try
            {
                if (name == "view" || name == "all")
                {
                    Updaters.ViewUpdater viewUpdater = new Updaters.ViewUpdater(application.ActiveAddInId);
                    UpdaterRegistry.DisableUpdater(viewUpdater.GetUpdaterId());
                }

                if (name == "grid" || name == "all")
                {
                    Updaters.GridUpdater gridUpdater = new Updaters.GridUpdater(application.ActiveAddInId);
                    UpdaterRegistry.DisableUpdater(gridUpdater.GetUpdaterId());
                }

                if (name == "sheets" || name == "all")
                {
                    Updaters.ViewSheetUpdater sheetUpdater = new Updaters.ViewSheetUpdater(application.ActiveAddInId);
                    UpdaterRegistry.DisableUpdater(sheetUpdater.GetUpdaterId());
                }

                if (name == "doors" || name == "all")
                {
                    Updaters.DoorRatingUpdater doorRatingUpdater = new Updaters.DoorRatingUpdater(application.ActiveAddInId);
                    UpdaterRegistry.DisableUpdater(doorRatingUpdater.GetUpdaterId());
                }

                if (name == "walls" || name == "all")
                {
                    Updaters.WallRatingUpdater wallRatingUpdater = new Updaters.WallRatingUpdater(application.ActiveAddInId);
                    UpdaterRegistry.DisableUpdater(wallRatingUpdater.GetUpdaterId());
                }

                if (name == "rooms" || name == "all")
                {
                    Updaters.RoomOccupantUpdater roomUpdater = new Updaters.RoomOccupantUpdater(application.ActiveAddInId);
                    UpdaterRegistry.DisableUpdater(roomUpdater.GetUpdaterId());
                }
                return Result.Succeeded;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return Result.Failed;
            }
        }

 

Re: Can I create MultiReferenceAnnotation in a viewplane?

Re: bug program

$
0
0

Unfortunately, this is not the best place to ask such a question.

 

Please note that this discussion forum is dedicated to programming Revit using the Revit API.

 

Therefore, you cannot expect an answer to a question such as yours relating to installation, product usage or end user support issues here.

 

You should try one of the non-API Revit product support discussion forums instead for that:

 

https://forums.autodesk.com/t5/revit-api-forum/this-forum-is-for-revit-api-programming-questions-not-for/td-p/5607765

 

The people there are much better equipped to answer your question than us programming nerds.

 

I hope this clarifies.

 

Thank you for your cooperation and understanding.

 

Best regards,

 

Jeremy

 

Re: Executing Move from Dock Pane Will Not Let You Complete the Command

$
0
0

Still no luck sorting this out, has anyone experienced this before?

Re: Vertically Compound Wall - Adding Splits and Layers

Viewing all 67020 articles
Browse latest View live


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