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

Re: ImageExport model coordinate

$
0
0

Dear Romain,

 

Thank you for your query and sorry for the delay in replying.

 

I cannot comment on the final image export coordinate part of your question, but the UIView class provides a possibility to convert between Revit model and the Windows screen display coordinate systems:

 

https://apidocs.co/apps/revit/2019/2a070256-00f0-5cab-1412-bee5bbfcfc5e.htm

 

I used that functionality to create my own Windows tooltip that queries properties of the Revit database elements at the current Windows cursor position:

 

http://thebuildingcoder.typepad.com/blog/2017/01/uiview-windows-coordinate-referenceintersector-tooltip.html

 

Does that help?

 

Best regards,

 

Jeremy

 


Re: Determine if an element is visible in a view

$
0
0

I can confirm this appears to work also.

Re: How to filter elements through the Tab?

$
0
0

Hi ,

You can also approach by using with the below code

 FilteredElementCollector mech_coll = new FilteredElementCollector(doc).OfClass(typeof(MechanicalSystem)).WhereElementIsNotElementType();
                IList<ElementId> mech_ids = mech_coll.ToElementIds() as IList<ElementId>;

Re: Changing Connector Height and Width properties

$
0
0

I would have thought that you can approach this in a simpler way.

 

I do not believe that you have to set up all these dimensions yourself.

 

If your system settings are properly configured, I would have thought that you can just connect the fitting with the duct and it will automatically adjust itself appropriately.

 

I used that functionality for simpler cases in setting up a rolling offset:

 

http://thebuildingcoder.typepad.com/blog/2014/01/final-rolling-offset-using-pipecreate.html

 

The routing preferences and RoutingPreferenceManager can be used to control what kind of fitting is auto-inserted between ducts under specific conditions:

 

https://apidocs.co/apps/revit/2019/a8300b97-72a6-beb5-733b-ec4cfea6c472.htm

  

For samples using it, please check out the SDK samples.

 

Cheers,

 

Jeremy

 

Re: FabricArea.Create failed

$
0
0

I'm asking the development team for you.

 

They will probably as me to raise a development issue for this for closer analysis.

 

Cheers,

 

Jeremy

 

Intersection work not correct

$
0
0

Hi!

 

I use next codes:

 

 

VertLn.Intersect(lorigin, resultArray)
lorigin.Intersect(VertLn, resultArray)

 

 vertln  is unbound line :

VertLn .Origin {(-17270067.966274336, -28577765.334089007, 0.000000000)} 

 VertLn.Direction {(0.000000000, 0.000000000, 1.000000000)} 

 

lorigin is unbound line:

lorigin .Origin {(-17270067.966274336, -28577765.334089007, 78783792.676743671)} Autodesk.Revit.DB.XYZ
lorigin .Direction {(0.000000000, 0.000036460, 0.999999999)} 

VertLn.Intersect(lorigin, resultArray)  ------------  Equal {64} Autodesk.Revit.DB.SetComparisonResult

lorigin.Intersect(VertLn, resultArray)  ------------  Disjoint {4} Autodesk.Revit.DB.SetComparisonResult

 

 

In my opinion those lines must to cross.

I don't understand why results are different and wrong.

 

 

Re: The program '[148xx] Revit.exe' has exited with code 0 (0x0).

$
0
0

Did you update the version of .Net to 4.7 or 4.7.2?

How to open Annotation Tag family and modify internally through Code_C#

$
0
0

Hi,

I am new in this area, Can you please help me how to modify Annotation Tag family through code ?

A process has been attached as snap (created at Revit 2017)

///////////

1. Open an existing *.rfa file
2. Provide new label/Edit existing label text
3. can select existing shared parameter as required
4. can add/remove and or able to provide prefix, suffix enable Break, also can re-arrange the index of listed parameter name (Label parameters).
5. the family category can be change as required.
6. Finally, the existing family will be save as new *.rfa file name in same location of existing file.

////////......Smiley Indifferent

Thanks in advance..


Re: FabricArea.Create failed

$
0
0

Hello,

 

If I understood you are trying to create a fabricArea using API in the only wall that is not parallel with X or Y. I guess the wall's direction is XY(0.7; 0.7) and that is why you are trying to use it as major direction for fabric area creation.

I did some testing on my machine using (0.7;0.7;0) and I did not manage to reproduce the problem.

But if my understanding of fabricArea is correct that is not necessary.  The XYZ major direction of fabric area seems to be in the UV of the wall and it is NOT in world coordinates. So you should use something simple like (1;0;0) or (0;0;1).

 

If this was not helpful please try to give us a .rvt with a macro that reproduces exactly what you are trying to do. This way we are sure that we understood the exact issue and we will be able to reproduce. Also faster debugging.

 

Regards,

 

 

 

OpenDocumentFile, CorruptModelException

$
0
0

All of a sudden, using app.OpenDocumentFile on a specific 2016 model causes this exception when opening with 2017 (upgrade).

 

Exception thrown: 'Autodesk.Revit.Exceptions.CorruptModelException' in RevitAPI.dll

Additional information: The model could not be opened: Data in file an unnamed file is corrupt and needs to be manually recovered.

(CArchiveException 105) occurred

 

The model opens fine with the 2017 Revit > Open dialog, so Autodesk Support says the model is not corrupt.

Has anyone had this issue? Any help on steps to resolve? 

Duplicated images when printing to PDF995

$
0
0

I have run into this error almost once a week at my job and don't know what else to try to fix it. When I print with PDF995 it duplicates the sheets printed like crazy. I attached an example of what is happening. 

 

I am on a Mac using Parallels, which shouldn't be the problem because my coworkers do the same thing and don't experience this problem. Has this happened to anyone else before? Does anyone know why it is happening? It is really starting to bug me and cause issues at work.

 

Please let me know. 

 

Thanks. 

Re: How to set up uidoc in Sharp Develop

$
0
0

I have taking two errors. What I'm not understanding?

var uiDocument = this.Application.ActiveUIDocument;
var document =  this.Application.ActiveUIDocument.Document;

        public void uu1()
        {
            FilteredElementCollector familyCollector = new FilteredElementCollector(document);
            familyCollector.OfClass(typeof(FamilySymbol));

        FamilySymbol familySymbolToFind = null;

        foreach (FamilySymbol familySymbol in familyCollector)

Re: Missing /AdWindows;component/themes/badge.xaml

$
0
0

That worked perfectly! Thank you for the help

Revit 2019 Walkthrough exporting issue

$
0
0

I was able to make the walkthrough and export the draft at 15frame per second no problem.  However,  when I change the frame rate to 24 or 30 frame per second. The exported avi file become corrupted and cannot be opened.  I can still convert to MP4, but the walkthrough starts from the middle to the end, then go to the beginning to the middle.  I checked every setting and cannot see anything wrong with my set up.  when I play it in edit walkthrough it's fine as well. Even when it's exporting I can see that it was starting from the beginning...

I am really pulling my hair out here.  Any help would be appreciated.  the video is only 30 second.

Re: Posting OwnedByother failure

$
0
0

i reached the same result does any one solved that.


Re: The program '[148xx] Revit.exe' has exited with code 0 (0x0).

$
0
0

Yes I have tried and some result! It's starts running Revit, then it stops after a couple of seconds and I get the message: The program '[1852] Revit.exe' has exited with code 0 (0x0).

Re: How to set up uidoc in Sharp Develop

Revit Content and assets

$
0
0

I don't have any content or assets to drop in... I don't have any materials... what the heck did I miss something.

also my Revit keeps failing with an error message saying an unrecoverable error has occurred The program will terminate

Re: The program '[148xx] Revit.exe' has exited with code 0 (0x0).

$
0
0

Did u update the references to revitapi.dll and revitapiui.dll To point to the 2019 files?

How to get distance (Width, Height & Depth) in Revit C# for the active document?

$
0
0

Hi,

Below is the VB Macros code which it is implemented in Autocad.

Sub GetAllDist()
Dim intOption As Integer

AppActivate ("Autodesk AutoCAD 2016")

intOption = MsgBox("Do you wish to select the dimension instead of drawing the distance?", vbYesNo, "Distance")

With ThisDrawing.Utility
    .Prompt vbCr & "Select length dimension..." & vbCrLf
    varData(9) = Format((funGetDist(intOption) / 12), "#0.0000")
    .Prompt vbCr & "Select width dimension..." & vbCrLf
    varData(10) = Format((funGetDist(intOption) / 12), "#0.0000")
    .Prompt vbCr & "Select depth dimension..." & vbCrLf
    varData(11) = Format((funGetDist(intOption) / 12), "#0.0000")
End With
intOption = MsgBox("Length: " & varData(9) & vbCrLf & "Width: " & varData(10) & vbCrLf & "Depth: " & varData(11), vbOKOnly, "Debug Info")

End Sub

Public Function funGetDist(intType As Integer) As Single

Select Case intType
    Case 7 'code to draw dist.
        Dim varBase As Variant
        Dim varEnd As Double
        
        On Error Resume Next
        
        With ThisDrawing.Utility
            varBase = .GetPoint(, vbCr & "    Pick start point: ")
            varEnd = .GetDistance(varBase, vbCr & "    Pick end point: ")
            funGetDist = CSng(varEnd)
        End With
    Case 6 'Pick Dim
        Dim objEnt As AcadDimension
        Dim varPick As Variant
        On Error Resume Next
            With ThisDrawing.Utility
            While objEnt Is Nothing
                .GetEntity objEnt, varPick
                If objEnt Is Nothing Then
                    .Prompt vbCrLf & "You did not select a dimension!"
                    .Prompt vbLf & "Please reselect."
                End If
            Wend
            End With
            funGetDist = objEnt.Measurement
    End Select

End Function

How to change the above code in c# for Revit 2017. Any help on this please?

 

Thanks,

Philip

Viewing all 66736 articles
Browse latest View live


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