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

Re: How can I launch my plugin from the surface edit mode?

$
0
0

Thank you Jeremy!
I want that by starting my plug-in, the revit goes into the edit surface mode (that is, I need a PostableCommand).
There I want the user to continue to interact with my plugin to insert points along the selected lines.


Re: How to place a Pipe flange using Revit API

$
0
0

tried creating pipe with all the overloads for Pipe.Create 

Didnt work..

Eventually I will do it the hard way round if nothing works... 

 

But since you suggested to disconnect the connectors.. How do I do that??

 

Two Addins from the same .dll in two locations

$
0
0

Is this possible?

My situation is that I am trying to have one .dll that contains an IExternalApplication and an IExternalDBApplication. One .addin points at the IExternalApplication in the assembly at one location with an absolute path. Another .addin points at the IExternalDBApplication that uses a relative path to another location since it is meant to be run on Forge. 

Revit is loading both addins from the relative path, which is causing issues since some of my code depends on the assembly location. Anyone know of a way to fix this or am I just going to have to bite the bullet and make it two projects?

 

Re: Array of Boxes (FilledRegion)

How to access ducts connected to a particular duct?

$
0
0

I'm trying to figure out how to get the duct elements attached to a particular duct. I'm wanting to "traverse" my ductwork and run some numbers. However, I'm not sure how to do this.

At the moment, I am using the Connector Manager and iterating through the Connectors. When I ask for the Connector's owner, it just gives me the duct I am looking at and not the other ducts it's connected to.

Am I going about this the wrong way? Or do I need to match every connector to every piece of duct using the IsConnectedTo method?

Cheers!

Re: Automatically Connect Load to Panel

$
0
0

Thanks for the reply  .  I placed another panel(same family and type as the first), ran it with the same code, and it worked and works for all other panels I am using this code with.  I'm not sure why it was giving me errors before, but all is well now.

Re: How to Make Installation Package

$
0
0
Dear jeremytammik Thank you for your help. I've already solved the problem. I used software "Nullsoft Install System",which is much faster and suitable for beginners. Thank you.

Re: BIM 360 REST API to get Model Size?

$
0
0

Hi Mehdi,

It's nice to hear that you found your own solution without playing with the Forge.

 

Cheers,


Cursor Jump to Project Browser While Switching between Projects

$
0
0

Dear API Community,

While I switch between projects, the cursor jumps to the Project browser/Properties palette.

I manage to find why. It is because of the mouse settings.
While I set the mouse cursor to "Automatically move the pointer to the default button in a dialog box, the cursor starts to behave in this way.

If I uncheck it, it works normally.

I believe this might be a bug.

Anyway, if anyone got a solution to fix this, kindly advise me.

Because it's quite annoying and the screen got a major jerk.

I attached a video to have better clarity on the issue.


Cursor.PNG

Re: How to Get and Set Project Paramters????

$
0
0

Hi  ,

Have you tried the below code?

 ParameterSet pS = doc.ProjectInformation.Parameters as ParameterSet;
                if(pS!=null)
                {
                    foreach(Parameter p in pS)
                    {
                       if(p.Definition.Name.Contains("your parameter name"))
                        {
                            p.Set(parametervalue);
                        }
                    }                   
                }

Re: How can I launch my plugin from the surface edit mode?

$
0
0

Dear Ilya,

 

Thank you for your update and clarification.

 

If you use PostCommand to launch a built-in Revit command, you get the full built-in Revit functionality with no possibility to modify or interact with it.

 

You get all or nothing.

 

If you are happy with that, go ahead.

 

If you wish to mix in your own functionality with the built-in Revit stuff, it will be much harder, or maybe impossible.

 

I hope this helps.

 

Best regards,

 

Jeremy

 

Re: Solid as OpenShell DirectShape

$
0
0

Hi,

 

Thanks Jeremy. Yes i feel i'm almost there. The progress i've made is creating Tessellated faces (see earlier posts)

With the same ShapeBuilder i now can build non triangled faces, only if they are planar (see image1, simple box) and they are individually selectable, what i need!

 

When using this with an object that doesn't have all planar faces you see it not creates all the single faces (image2)

The result i need is the same as image3 but this is a solid shape and i need individually faces. So the conclusion for now is that Tessellated builder can't build my non planar shape in individually faces that aren't triangled. Anyone an idea what the right builder?

 

 

Annotation 2019-06-13 095239.pngAnnotation 2019-06-13 095338.pngAnnotation 2019-06-13 095440.png

List<Solid> sol = new List<Solid>();

Solid loft = GeometryCreationUtilities.CreateLoftGeometry(profileLoop, options);

sol.Add(loft); foreach (Solid s in sol) { foreach (Face f in s.Faces) { Build_Tessellate2(f); ElementId categoryId = new ElementId(BuiltInCategory.OST_GenericModel); DirectShape ds = DirectShape.CreateElement(doc, categoryId); ds.ApplicationId = System.Reflection.Assembly.GetExecutingAssembly().GetType().GUID.ToString(); ds.ApplicationDataId = Guid.NewGuid().ToString(); foreach (TessellatedShapeBuilderResult t1 in Build_Tessellate2(f)) { ds.SetShape(t1.GetGeometricalObjects()); ds.Name = "Single_Surface"; } } }

public List<TessellatedShapeBuilderResult> Build_Tessellate2(Face faces) { Mesh mesh = faces.Triangulate(); List<XYZ> vert = new List<XYZ>(); foreach (XYZ ij in mesh.Vertices) { XYZ vertices = ij; vert.Add(vertices); } TessellatedShapeBuilder builder = new TessellatedShapeBuilder(); builder.OpenConnectedFaceSet(false); //Filter for Title Blocks in active document FilteredElementCollector materials = new FilteredElementCollector(m_revit.Application.ActiveUIDocument.Document) .OfClass(typeof(Autodesk.Revit.DB.Material)) .OfCategory(BuiltInCategory.OST_Materials); ElementId materialId = materials.First().Id; builder.AddFace(new TessellatedFace(vert, materialId)); builder.CloseConnectedFaceSet(); builder.Target = TessellatedShapeBuilderTarget.AnyGeometry; builder.Fallback = TessellatedShapeBuilderFallback.Mesh; builder.Build(); TessellatedShapeBuilderResult result3 = builder.GetBuildResult(); List<TessellatedShapeBuilderResult> res = new List<TessellatedShapeBuilderResult>(); if (result3.Outcome.ToString() == "Sheet") { res.Add(result3); } return res; }

 

 

Re: insert windows family plugin

$
0
0

Hello, can I get help with this API? I don't understand why it doesn't work.

Thank you
Capture.PNG

 

Re: Solid as OpenShell DirectShape

$
0
0

You say, '... an object that doesn't have all planar faces ... (image2)'.

 

However, as far as I can tell, all the faces in image2 are planar after all.

 

Why do you say they are non-planar?

 

Re: Solid as OpenShell DirectShape

$
0
0

It's hardly to see in the image.

 

Attached you can find the RVT model as a solid


Security - Signed Add-In error

$
0
0

I have been working with  Autodesk techs for several weeks and they cannot seem to come up with a solution to the error message I get when I fire up Revit 2019.2.1

I am greeted with a pop-up message "Security - Signed Add-In" for the add-in app DPR Model Slicer. Although I choose 'Always Load', the certificate is not loaded into Revit or the Windows registry.

I have loaded other 'signed add-ins' and get the same error message. However,  when an UNSIGNED add-in is loaded, I get the options to Always Load, Load Once, Do Not Load. Choosing Always Load, the pop-up is never seen again and the add-in is loaded into the Windows registry. Here is the catch, the error only appears in Revit 2019...not 2018 or 2020...???

Does anyone here have a clue what can be done to resolve this nuisance pop-up window without simply removing add-ins that I use every day and have used without faults for several years?

Re: Cursor Jump to Project Browser While Switching between Projects

$
0
0

Dear Radish,

 

Thank you for your query.

 

I do not see why you submitted this to the Revit API forum, though.

 

Are you observing this behaviour in your own add-in, or in the built-in Revit functionality?

 

In the former case, can you not fix the problem yourself?

 

In the latter case, 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

 

Russian letters doesn't export in lookup tables

$
0
0

Hello!

 

We've faced with the following issue: lookup tables with russian letters exports incorrectly (via GUI or via API, doesn't matter). The problem is that a data with at least one russian symbol doesn't export at all, however Revit undertand and show this letters correctly.

 

Steps to reproduce:

 

1. Import .csv file with the following data:

,B##length##millimeters
РУССКИЕ БУКВЫ,150.000000

РУССКИЕ LETTERS,150.000000
ENGLISH LETTERS,150.000000

 

2. Export this table. Exported table will contain:

,B##length##millimeters
,150.000000

,150.000000
ENGLISH LETTERS,150.000000

 

Revit's interface is Russian (of course :)). The issue is reproducing in Revit 2018, Revit 2019 and Revit 2020.

Re: How can I launch my plugin from the surface edit mode?

$
0
0

Thanks Jeremy!

 

In general, this was the idea.
So I'm not sure that "or maybe impossible" will help me ...
I hope that "it will be much harder".

Is there a possibility to place my add-in button to the ribbon of surface editing, which will allow the user to call it from there?

How do I hide text of an Autodesk.Revit.UI.RibbonItem?

$
0
0

I've found posts regarding the ability of the Autodesk.Windows (adWin) ribbon objects to hide the text through the ShowText Boolean property. However, I have already built most of my application with the Revit.UI button types, and am wondering if it's possible to somehow hide the text for stacked PushButtons, as shown in the attached image of the clipboard panel. I would prefer to find a way to either convert one namespace button type into the other namespace (Revit.UI => adWin, or vice versa) to achieve this rather than completely rewriting my OnStartup function to utilize the adWin namespace button types. Is this possible? Or is there some trick for Revit.UI button types that hide text without having to set the property to ChrW(20) (which also "hides" the text in the tooltip)? Or do I need to just start converting my OnStarup function to adWin?

 

I'm looking to make a sort of matrix of stacked buttons, and to be forced to keep text visible in the ribbon would expand the width of my panel far beyond what I'm willing to allow.

Viewing all 67020 articles
Browse latest View live


Latest Images