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

Re: PromptForFamilyInstancePlacement - "Encountered an improper argument&qu

$
0
0

Hi  ,

When your code hits the line uidoc.PromptForFamilyInstancePlacement(fs) then it asks the user to place instances of the specified FamilySymbol at a particular location.

During this process, your Project Browser is greyed out which means you can't select the level and when you click on the project browser you will get this error message.

Since your Revit expects the location to place the family symbol you can place the element at a particular location or you can cancel the process.

 

I hope this helps.

 


Re: Projection Transformation

$
0
0

Some more feedback from the development team on the ideas discussed above:

 

Regarding Document.ConvertModelToDetailCurves and Document.ConvertModelToSymbolicCurves: the user should be aware that if they produce curves that Revit considers invalid, such as self-intersecting curves or zero-length curves, they may cause problems if they're used in creating Revit geometry (or in other contexts for that matter). However, a quick look at the internal function those API functions call indicates that it does check if the projection curve (i.e., the result) would have singularities or self-intersections and does not return a result in such cases. So, I would guess that the same is true for the two API functions.

 

Note, too, that there are cases when users might want to allow the projection curve to be self-intersecting. For example, if a full circle lying in a vertical plane is projected to a horizontal plane, some users might want that operation to succeed and to return a line segment representing the "shadow" of the circle (as if the sun were directly overhead). I don't believe the Revit API provides such a function.

get IfcExporter setupnames

$
0
0
Guys,
 
I'm struggling how to get the IfcExporter setupnames (addin). I thought I would be able to get it through Autodesk.Revit.DB.ExtensibleStorage and use a lookup on the schema using ifcexporters guid.
But I'm struggling.
 
Does anybody have a clue?
 

Re: doc.Create.NewTag

$
0
0

You can also use the Create Independent Tag Node from the Genius Loci Package.

Re: Revit 2017:difference between manually copy and copy with api

$
0
0

I find the problem is because of code:

var instance = revit.Doc.Create.NewFamilyInstance(pointNew, symbol, StructuralType.NonStructural);
                                var namePara = instance.LookupParameter(ProjectAllCommunicationDeviceInfo.propNameKey);

                                if (namePara != null)
                                {
                                    namePara.Set(cabinetName);
                                }

After 'Create.NewFamilyInstance',if I modify parameter with set method,later, it will be very slow to modify other parameters.

Re: Revit 2017:difference between manually copy and copy with api

$
0
0

Hi,

 

the title is absolutely misleading.

 

You do not copy elements at all but you create new ones - that's a difference.

See ElementTransformUtils.CopyElements for copying Elements by API.

 

 

Revitalizer

Re: PromptForFamilyInstancePlacement - "Encountered an improper argument&am

$
0
0

Hi Naveen

 

Thanks for your reply. But the wording of the message is terrible and probably no message is needed. Maybe a bug could be filed to reword or remove it?

How to get the a window outer boundary?

$
0
0

If I have a irregular window like a triangle o trapezoid, How to I can get the outer boundary of that window?

The window can by hosted or not so, the use of some wall as reference for opening is not possible.

I need get the outer boundary used for the family symbol..


Re: How to get the a window outer boundary?

Re: How to get the a window outer boundary?

$
0
0

Thanks for the tip but I see the topic is using a wall or opening as reference for the calculation and I need get the outer boundary alone, not as reference of a host, opening cut or something else.

 

Thanks..

Re: Setting the BrowserOrganization for a project in Revit 2016?

$
0
0

I trying to figure out how to get the Filtering and Grouping and Sorting rules for the current BrowserOrganizationForViews, but I'm having trouble finding them in the BrowserOrganization object. I can only find corresponding properties to the sorting properties:

 

BOP_GroupSort.pngBOP_Filter.png

 BOP_Props.png

 

 Where can I find the rest of the rules?

Re: Combine connected edge segments into one continuous line.

$
0
0

Hi Jeremy,

First of all, Thank you, that helped me a lot and I am really close to a solution.

My scenario is slightly different as I am only using horizontally aligned edges of the exterior face of the geometry, I think it actually makes it easier because I don't have to sort the edges but sort only the segments that would compose one straight edge.

I used the python node on dynamo to prototype what I need (The visual 3d space there helps me with debugging).

What I am doing is getting a list with al the Edges.AsCurveLoops separating the horizontally aligned ones, the algorithm will evaluate that list and will group the curves to be joined into sublists because I was already making sure that all the curves are oriented in the same direction I just need to  pair the curves start points with its matching endpoints until and use the unmatched points  to form my "new" undivided edge curve, I will use the logic in here: https://stackoverflow.com/questions/13114378/sorting-vertices-of-a-polygon-in-ccw-or-cw-direction for that.

I know that this code can be optimized up but I will post it here for the sake of completion. It might help someone.

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
import Autodesk
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
#from Revit import GeometryConversion as gp

import math

curves = IN[0]
#The next 2 methods will assume that the directions is known.
#The start point of a curve
def startPoint(curve):
    return curve.GetEndPoint(0)

#The end point of a curve
def endPoint(curve):
    return curve.GetEndPoint(1)
#Groups lines to be joined in sublists with the curves that have to be joined    
def joinCurves(list):
	comp=[]
	re=[]
	unjoined = []
	for c in curves:
		c = c.ToRevitType()
		match = False
		for co in comp:
			if startPoint(c).IsAlmostEqualTo(startPoint(co)) and endPoint(c).IsAlmostEqualTo(endPoint(co)):
				match = True
		if match:
			continue
		else:
			comp.append(c)			
			joined = []
			for c2 in curves:
				
				match = False
				c2 = c2.ToRevitType()
				for co in comp:
					if startPoint(c2).IsAlmostEqualTo(startPoint(co)) and endPoint(c2).IsAlmostEqualTo(endPoint(co)):
						match = True
				if match:
					continue
				else:
					if c2.Intersect(c) == SetComparisonResult.Disjoint:
						continue
					elif c2.Intersect(c) ==  SetComparisonResult.Equal:
						continue
					elif c2.Intersect(c) == SetComparisonResult.Subset:
						comp.append(c2)
						joined.append(c2.ToProtoType())
		joined.append(c.ToProtoType())
		re.append(joined)
		
	return re
		
result = joinCurves(curves)
OUT = result

Cheers,

Re: Combine connected edge segments into one continuous line.

$
0
0

Dear Lucas,

 

I am very glad that it helped! 

 

Thank you for the appreciation and sharing your experimental code.

 

Yes, it looks as if some optimisation and cleanup can be done, and it can be made a bit shorter and more readable.

 

Cheers,

 

Jeremy

  

Re: How to get the a window outer boundary?

$
0
0

i can take a look, can you share your window family? 

Re: PromptForFamilyInstancePlacement - "Encountered an improper argument&am

$
0
0

You can trap error statements like this yourself with a try-catch statement.

 

programmers should always be thinking about ways that a user can cause errors, and if possible, prevent them from terminating the program with a confusing error message.


Re: PromptForFamilyInstancePlacement - "Encountered an improper argument&am

$
0
0

This is not an exception that can be caught with a try/catch

Yes, it might be possible to automatically dismiss it with the DialogBoxShowing event.

But the point of my post was to ask Autodesk to fix this.

cannot install revit i update photos error

Re: Revit 2017:difference between manually copy and copy with api

$
0
0

Hi Revitalizer,

thans for your reply.

 

Sorry, I forgot to say that copying and creating are the same result.

Now I've looked deeper into the problem,

I found that the root cause was that the family I used had a text parameter,

if I set the same value for this text parameter for all family instances, there will be no problem,

however, if I set a different value, the problem will occur.

I don't know why.

Do you know what causes this?

Re: Revit 2017:difference between manually copy and copy with api

$
0
0

I forgot to say that the text parameter is linked to a model text as the title of the family instance.

Re: Revit 2017:difference between manually copy and copy with api

$
0
0

In case of the above problems,

it seems that when I modify the parameters of the family instance,

revit regenerates all my family instances?

My CPU usage continued to increase during this period,

and it didn't go down to the previous level.

Viewing all 66664 articles
Browse latest View live


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