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

How to connect two cable trays in bottom Vertical Justification by Revit API?

$
0
0
 
 
How to connect two cable trays in bottom Vertical Justification by Revit API?

 

Hi, 

 

When I use Revit ribbon drawing function, it is easy to connect two cable trays with bottom Vertical Justification, but I can't do it by Revit API.

 

I know the RBS_CURVE_VERT_OFFSET_PARAM parameter. After I create the two cable tray, I set the value of the RBS_CURVE_VERT_OFFSET_PARAM parameter to bottom, and then create a Transition Fitting by NewTransitionFitting Method, but it doesn't work.

 

Best Regards,

Zhangzg

 

QQ截图20181129154226.pngQQ截图20181129154403.png


Re: PromptForFamilyInstancePlacement/DocumentChanged returning unexpected elemen

$
0
0

Bumping this up to the top again.

 

Our client is still experiencing this issue and we are still at a loss to explain it.

 

Manually placing instances of the same family via Revit (not our add-in) works as expected.  However, consistently calling the same functionality via the API exhibits this broken behavior.

 

Any insight is appreciated.

-Greg-

Re: multistorey stair subements

$
0
0

Dear Paul,

 

I continued discussing this with the development team, and they reply:

 

This should be possible, right?

 

Yes. You could pass the level of instance to `LinkElementId placementLevelId` to create the number system.

 

The API should be able to find the corresponding instance of the run `elementId` on the placement level and tag it.

 

I hope this helps.

 

I would love to see a running sample of this to share, once you have it sorted out.

 

Thank you!

 

Cheers,

 

Jeremy

 

How to connect a horizontal cable tray with a vertical cable tray by Revit API?

$
0
0

Hi, 

In following picture, there is a horizontal cable tray, and I want to draw a vertical cable tray starting from the middle point of the horizontal cable tray. when I use Revit ribbon drawing function, the horizontal cable tray and the vertical cable connect very well. But I am sure the horizontal cable tray is not split by the vertical cable tray, and an extra connector is added to the horizontal cable tray on the middle point, and a connection is made between this added connector from the horizontal cable tray and one end connector from the vertical cable tray. And no tee fitting is added.

QQ截图20181129161934.png

 

How can I do that by Revit API? when I use NewTeeFitting method to do it, it return null directly.

 

Best Regards,

 Zhangzg

Re: Raising ExternalEvent stops before Execute method

$
0
0

I have now commented out the entire Execute-method without any success. It doesnt read the name of the External Event or Invoke the Execute method… 

Re: TagText From Room Tags

$
0
0

Hi  Understood, that is obvious. Hence my question on how I can cast them as Independent Tags to use the TagText class? When using Python, I can feed a list of Room Tags and use .TagText to retrieve their respective data, so I know its possible. I am trying to understand how I can achieve this through C#.

Re: TagText From Room Tags

$
0
0

Hi,

 

also the RoomTag class has a TagText property.

As already pointed out, IndependentTag and RoomTag are completely different classes.

They are not derived from one another but from Element, their common ancestor.

You cannot a RoomTag element as an IndependentTag because it is not derived from it.

 

Cast the Elements as RoomTag, get their RoomTag.TagText property, and you are done.

 

 

Revitalizer

Re: TagText From Room Tags

$
0
0

 

Thank you for your response. I think the confusion comes from the fact that I am trying to make this work for Revit 2015. Looking through the API I was only located to Independent Tags as having the TagText property unless I am mistaken. I couldn't find nor access TagText when associating it to a RoomTag in Revit 2015 API, which is why I was asking if I had to turn them into Independent Tags. I suppose my question should be reiterated to can I retrieve the TagText of Room Tags in 2015 or am I limited to a more recent version?


How to create a tee fitting of not 90 degree branch angle for pipe by Revit API?

$
0
0

Hi,

When I use Revit ribbon drawing function, it is easy to create a tee fitting of any branch angle for pipe. 

QQ截图20181129171929.png

But when using NewTeeFitting method to do it, if the angle of branch is not 90 degree, then an InvalidOperationException throw. How can I create a tee fitting of not 90 degree branch angle for pipe by Revit API?

 

Best Regards,

Zhangzg

Re: How to connect a horizontal cable tray with a vertical cable tray by Revit A

$
0
0

Hi!

 

I tried to create a vertical cable tray and connect it to the existing horizontal tray manually, but it didn't work for me, e.g. Revit didn't create tee fitting in my case, so may I and you miss something?

 

I wrote a Revit Python Shell script (without any checks, that should be presented in a production code), that successfully creates a tee fitting when cable tray is horizontal. Look at this small example, please:

from Autodesk.Revit.DB.Electrical import *

def FindCableTrayConnector(cableTray, point):
	return filter(lambda x: x.Origin.IsAlmostEqualTo(point), cableTray.ConnectorManager.Connectors)[0]

existingTray = selection[0] # you should select a horizontal cable tray before running this script

pt = existingTray.Location.Curve.Evaluate(0.5, True)

tx = Transaction(doc, "create cable tray")
tx.Start()

ptEnd = pt + existingTray.Location.Curve.Direction.CrossProduct(XYZ.BasisZ)*10
# ptEnd = pt + 10*XYZ.BasisZ # in such case NewTeeFitting returns None and there no fitting is created

branchCableTray = CableTray.Create(doc, existingTray.GetTypeId(), pt, ptEnd, existingTray.ReferenceLevel.Id)

newCurve = existingTray.Location.Curve.Clone()

newCurve.MakeBound(0, 0.5*existingTray.Location.Curve.Length)

existingTray.Location.Curve = newCurve

newCableTray = doc.GetElement(ElementTransformUtils.CopyElement(doc, existingTray.Id, pt - existingTray.Location.Curve.GetEndPoint(0))[0])

doc.Regenerate()

c1 = FindCableTrayConnector(existingTray, pt)
c2 = FindCableTrayConnector(newCableTray, pt)
c3 = FindCableTrayConnector(branchCableTray, pt)

print doc.Create.NewTeeFitting(c1, c2, c3)

tx.Commit()

Re: TagText From Room Tags

$
0
0

Hi,

 

now I see the problem.

A quick check using RevitLookup shows that there is no access to the RoomTag's text value.

Neither as a property nor as a parameter, visible or hidden.

And also no access via Reflection.

 

I would say, there is no solution for your Revit 2015 problem.

 

Revitalizer

Re: How to connect a horizontal cable tray with a vertical cable tray by API

$
0
0

Hi Aignatovich,

 

Thank you for your reply.

 

You are correct: Revit didn't create a tee fitting, but the horizontal cable tray and the vertical cable tray do connect well even there is no tee fitting. I don't know why.

 

I have read your code, and I know it works well when the two cable tray are both horizontal.

 

But I want to know how to connect a horizontalcable tray with a verticalcable tray by API.

 

Best Regards,

Zhangzg

 

 

 

Dimensioning problems with stud walls

$
0
0

We like to dimension to face of stud. When we change our wall type to show the gyp. wrapping the stud, it no longer allows us to select the end point of the stud (red point in attached image). Any solution besides faking it with a reference line?

 

get FamilySymbol from Family

$
0
0

I used the following code to retrieve an element and I can see the FamilyName parameter and its value in the debugger in Visual Studio. How can cast or what can I do to get the value of the FamilyName? This is for a Fabrication Part.

 

Element elemType = dbDoc.GetElement(fp.GetTypeId());

 

Re: TagText From Room Tags

$
0
0

 

I appreciate your help, nonetheless. Thank you.


Addin Manifest - Unknown Publisher

$
0
0

Is there anyway to modify the addin file to include the Publisher name or is a digital signature required to do that? See Attached image. Thank you.

Re: Addin Manifest - Unknown Publisher

Revit export ddXML?

$
0
0

Anyone:

 

Since Revit's duct pressure loss calculation tools are uneven at best, is there any chance that a well-connected duct system can be exported to ddXML, so that duct pressure loss calcs can be completed in Trane VariTrane Duct Designer?

 

This was possible with Autocad ABS 2006, so the coding to the schema has already been done within Autodesk - can this schema be translated to C# and made part of the Revti API?

 

Trane has a 16-page document for the schema that I have attached.

 

Any help is appreciated.

 

Thank you

Problem with AssignedPressureDrop property

$
0
0

Hi,

I have problem with set AssignedPressureDrop property.
This property return double value.

public double AssignedPressureDrop { get; set; }


My code work only when I set integer value like 10:
item.MEPModel.ConnectorManager.Lookup(1).AssignedPressureDrop=10;

but i can't set double value:
item.MEPModel.ConnectorManager.Lookup(1).AssignedPressureDrop=10.123;

Any ideas how to make it work?

Re: multistorey stair subements

$
0
0

Dear Paul,

 

Here is a sample code snippet:

 

  ICollection<ElementId> runIds = stairs.GetStairsRuns();
  foreach (ElementId runId in runIds)
  {
    StairsNumberSystemReferenceOption option
      = StairsNumberSystemReferenceOption.LeftQuarter;
    LinkElementId hostId = new LinkElementId(runId);
    LinkElementId linkedLevelId = new LinkElementId(level.Id);
    NumberSystem.Create(RevitDoc,
      level.FindAssociatedPlanViewId(), hostId, option,
      linkedLevelId);
  }

 

I hope this helps.

 

Cheers,

 

Jeremy

 

Viewing all 67020 articles
Browse latest View live


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