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

Re: Printing to a custom filename when creating SEPARATE files.

$
0
0

Thanks for your reply, It works and I think it should be accepted as a solution of this issue. 

I still need to find out how to change the file address.

Thanks again.

 


Re: Dimension on Hatch Pattern Slab

$
0
0

I guess you can use  workaround, he draws a dimension to know where are the pattern grids, their angle, and the distance between them. Once you know that, you can use this to draw several lines (maybe unbound) then you can intersect them with the floor face edges ignoring lines outside of the floor.

Get a point on the edge of an element

$
0
0

Hi,

 

I am trying to get a point of an element by picking the edge of that element, but I am getting error "Object reference not set to an instance of an object."

Below is my code, can anyone help me on this?

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.DB.Structure;

namespace Adaptive_family
{
[TransactionAttribute(TransactionMode.Manual)]
public class Points_on_curve : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIDocument uidoc = commandData.Application.ActiveUIDocument;
Document doc = uidoc.Document;
FilteredElementCollector collector = new FilteredElementCollector(doc);
try
{
Reference pickobj = uidoc.Selection.PickObject(ObjectType.Edge);

if (pickobj != null)
{
GeometryObject geo = doc.GetElement(pickobj).GetGeometryObjectFromReference(pickobj);
Curve line = geo as Curve;

XYZ pt = line.GetEndPoint(0);

}
}
catch (Exception a)
{
message = a.Message;
return Result.Failed;
}
return Result.Succeeded;

}

 

}
}

 

Thanks

M. A. Mohammed Riaz

Re: Get a point on the edge of an element

$
0
0

Hi  ,

Pickobject helps you to select an element based on point, face, edge.(i.e)Element is returned not points

 

To select point use PickPoint

uiDocument.Selection.PickPoint(ObjectSnapTypes, "SELECT POINT");

 

I hope this helps.

 

Re: Get a point on the edge of an element

$
0
0

Hi  ,

 

Thanks for your quick response.

 

I want to pick a edge and convert that edge in to curve, so that I can a point where ever I want like in mid or 3/4 etc,.

 

That's why I am trying this option, if any other option is there means please let me know.

 

Thanks

Re: Get a point on the edge of an element

Re: Get a point on the edge of an element

$
0
0

Hi  

 

Sorry, I am not looking for that.

image.png

I need to select a edge of beam, then get points at some intervals to place my family at that point. Mainly this is my task looking right now.

 

Thanks

M. A. Mohammed Riaz

 

Re: Get a point on the edge of an element

$
0
0

Hi  ,

Also, try using this code

Reference R = uidoc.Selection.PickObject(ObjectType.Edge);
ElementId eid = R.ElementId;
Element e = doc.GetElement(eid);
 GeometryObject GO = e.GetGeometryObjectFromReference(R) as GeometryObject;
 Edge edge = GO as Edge;
 Curve C = edge.AsCurve();

 


Re: Get a point on the edge of an element

$
0
0

Hi  

I included some syntax from your advise in  my script as below and got worked,

 

if (pickobj != null)
{
GeometryObject geo = doc.GetElement(pickobj).GetGeometryObjectFromReference(pickobj);

 Edge edg = geo as Edge;
Curve line = edg.AsCurve();

XYZ pt = line.GetEndPoint(0);

}

Thank you a lot.

Re: Independent Tag Color Help!

$
0
0

How did you create the markings?
Сan you send me a code, if it's not a secret?

Help me pleace!
Thanks!!!

Re: How to create marker for sockets?

Re: Independent Tag Color Help!

$
0
0

What do you mean by marking? My code returns the conduit filter color and based off that, the code overrides the independent tag graphics to the conduit filter color if that makes any sense. 

Re: Revit Namespace and Autodesk.Geometry Namespace documentation

$
0
0

I received an email from the forum saying that Nicholas responded.

 

Since his response does not appear here, I assume something went wrong with the post, so I am adding it for him:

 

@naveen.kumar.t @jeremytammik   Sorry for not being clear at the beginning, I was referring to the namespace inside of the RevitNodes.dll and the ProtoGeometry.dll. I am wondering if there exists documentation for them like in the Revit API:

 

https://www.revitapidocs.com

 

By the way @jeremytammik great blog! I have just started to script within Revit and you have a lot of cool info, thanks for sharing your knowledge with the community. At the moment I am developing some Zero Touch Nodes, and it is very interesting to see how different it is than developing in the Grasshopper environment in Rhino.

Re: Revit Namespace and Autodesk.Geometry Namespace documentation

$
0
0

Thank you for your appreciation!

 

I am not aware of those API assemblies. Maybe they are not intended for public use. That would explain the lack of documentation.

  

Re: Part of stack trace is gone?

$
0
0

What's ExporterManger?  I don't use it. My plugin Exception: Index out of range and don't tell me this track stack. I don't know how to solve it.


Re: Dimension on Hatch Pattern Slab

$
0
0

yes  's workaround gives References to the grid lines and we can use it to create a dimension string. But I'm trying to figure out how to get XYZ coordinates of the grid line or only one point on it so that I can draw a line that overlaps the gridline.

Re: How do I save a selected parameter in Extensible storage?

$
0
0

Hi Jason,

 

Apologies for my long delay in marking your response as the solution. This is one part of a larger addin i'm trying to make so had to continue with other items before circling back to this.... it's also my first addin so it took me a long time to figure it out!

 

I've gotten the custom parameters working using filters. I ended up using sharedParameterElement as the extra custom parameter for my filter selection. 

 

A few extra notes if anyone is ever trying to do the same:

 

I Had to create a dictionary of storage vs. parameter types for the typeOfStorage() lookup. This is certainly not the correct way of doing but I filtered all elements then added them to the dictionary.

Also, had to create a list of all sharedparameterelements to use as a lookup, so in the loop above to get the storage types also output all the sharedParameterElements to a List for lookup.

 

Once again, thanks a million for pointing me in the right direction!

 

Cheers,

 

Paul

Logo SVG Files

$
0
0

While not exactly an API question this is semi related. What is the process for getting product specific logo svg files?

Unitechnik CAD-CAM interface - UXML

$
0
0

Our client is using a new plotter that uses XML files as input. I wonder is anyone knows the details of the UXML files, such a format introduction or a standard white paper? I searched for a while, then I did not get any useful information.

Thanks a lot.

 

James

Re: Logo SVG Files

$
0
0

Probably the most expedient way will be to download the pixel-based files. They are readily available. Then, vectorise them manually and save in SVG yourself. Unless, of course, you can find the SVG files directly wherever you can find the pixel-based ones. In either case, please let us know what you find out and how you end up solving this. Thank you!

 

Viewing all 66666 articles
Browse latest View live


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