Coder Social home page Coder Social logo

the_building_coder_samples's Introduction

The Building Coder Samples

The Building Coder Samples illustrate numerous aspects and example usages of the Revit API.

Please refer to The Building Coder for further information.

Keywords: Revit API C# .NET add-in.

Installation

You can install each individual command separately by creating an add-in manifest file for it, e.g. TheBuildingCoderSingleSample.addin is set up to load the external command CmdDemoCheck.

Simply copy both BuildingCoder.dll and TheBuildingCoderSingleSample.addin to the Revit Add-Ins folder.

To save implementing a separate add-in manifest entry for each individual command, you can also use the Revit SDK sample RvtSamples.

It is an external application that reads a list of external commands from a text file and creates a ribbon menu to launch them all.

BcSamples.txt lists all The Building Coder sample commands in the required format to be used as an RvtSamples include file.

Author

Mainly implemented and maintained by Jeremy Tammik, The Building Coder and The 3D Web Coder, Forge Platform Development, ADN Open, Autodesk Inc., with lots of help from the entire Revit add-in developer community.

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

the_building_coder_samples's People

Contributors

cadbimdeveloper avatar jeremytammik avatar mmcpt avatar nice3point avatar so-chong avatar stenci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

the_building_coder_samples's Issues

Room Neighbours

Hi,
I was trying to use from
http://thebuildingcoder.typepad.com/blog/2013/09/room-neighbours.html.

But I couldn't run the project with the latest version of Revit and got some errors.
So, I tried with the latest version of BuildingCoder from here with the latest version of Revit.
I built without any errors, but I can not see the same result like following.

image

How can I get the same result ?

Thanks

Jay

A question about CmdBrepBuilder

Dear Jeremy,
I have a question about the code (the_building_coder_samples/BuildingCoder/BuildingCoder/CmdBrepBuilder.cs ) at line 41 and line 42.The notation should be front side. ZY plane, X = 100 insdead of front side. ZY plane, X = 0. The front plane is in the positive direction of the x-axis and it's normal points inside the cube. But the top plane and right plane are both in the positive direction of the axis and the normal direction is pointing to the outside of the cube.This confuses me.
Regards, Allen.

press.key method - keyboard shortcut problems in Revit 2019

the "cmdpresskey" method worked for me since Revit 2014 - Revit 2018.
I made keyboard shortcuts for many commands like Textnotes, Dimensions.
But, I could not make these keyboard shortcuts work anymore for Revit 2019.
I think the problem could be in these codes:
public class Press
{
[DllImport( "USER32.DLL" )]
public static extern bool PostMessage(
IntPtr hWnd, uint msg, uint wParam, uint lParam );

[DllImport( "user32.dll" )]
static extern uint MapVirtualKey(
uint uCode, uint uMapType );

enum WH_KEYBOARD_LPARAM : uint
{
KEYDOWN = 0x00000001,
KEYUP = 0xC0000001
}

enum KEYBOARD_MSG : uint
{
WM_KEYDOWN = 0x100,
WM_KEYUP = 0x101
}

enum MVK_MAP_TYPE : uint
{
VKEY_TO_SCANCODE = 0,
SCANCODE_TO_VKEY = 1,
VKEY_TO_CHAR = 2,
SCANCODE_TO_LR_VKEY = 3
}

However, I could not resolve this issue.

Jeremy, please help!

Thank you so much for this.

Elton

How to get the face normal of a referencePlane in familyInstance?

I looked at the following url, line 77 to 100.
https://github.com/jeremytammik/the_building_coder_samples/blob/97864c67b86027c3b54824925a690449b6ce593b/BuildingCoder/BuildingCoder/CmdGetDimensionPoints.cs

FamilyInstance fi=element as FamilyInstance;
Reference ref1 = fi.GetReferenceByName("aName");// a referencePlane named "aName" in family.
Element el = _rvtDoc.GetElement(ref1.ElementId);
GeometryObject obj = el.GetGeometryObjectFromReference(ref1);
if (obj == null)
{
MessageBox.Show("code will never be here");
// element is Grid or ReferencePlane or ??
ReferencePlane refPl = el as ReferencePlane;
if (refPl != null) { MessageBox.Show("Yes"); }
else { MessageBox.Show("NO"); }
}
else
{
Line l = obj as Line;
if (l != null) {
MessageBox.Show("Line");
}
PlanarFace f = obj as PlanarFace;
if (f != null)
{
MessageBox.Show("Face");
}
Point p = obj as Point;
if (p != null)
{
MessageBox.Show( "P");
}
//I tried everything, and none of them succeeded.
/*include:
Curve
Edge
Face
GeometryElement
GeometryInstance
Profile
Solid
Mesh
PolyLine */
}

Is there somewhere I've overlooked?

Restrictions in Material names

Hello Jeremy ๐Ÿ˜ƒ
I want to set a name to a material, but there're some restrictions that are undocumented.

So, here's my test-case

Material defaultMaterial = new FilteredElementCollector(doc)
  .WherePasses(new ElementClassFilter(typeof(Material)))
  .Where<Element>(e => e.Name.Equals("Default"))
  .FirstOrDefault<Element>() as Material;

String materialName = "Concrete 1:4";
Material createOrUpdateMaterial = new FilteredElementCollector(doc)
  .WherePasses(new ElementClassFilter(typeof(Material)))
  .Where<Element>(e => e.LookupParameter("Name").AsString().Equals(materialName))
  .FirstOrDefault<Element>() as Material;

if (createOrUpdateMaterial == null) {
  createOrUpdateMaterial = defaultMaterial.Duplicate("createorupdate default");

  // Why Revit doesn't accept the ':' char?
  createOrUpdateMaterial.Name = materialName;

  // Why Revit doesn't link the Parameter("Name") with the Property "Name"?
  createOrUpdateMaterial.LookupParameter("Name").SetValueString(materialName);
}
  • Why Revit doesn't accept the ':' char?
  • Why Revit doesn't link the Parameter("Name") with the Property "Name"?
  • Does Revit have other restrictions?

I'll be happy if you give me an advice. Thanks a lot, Jeremy!

Update to Revit 19

Hi Jeremy. Would it be possible to update the VisualStudioRevitAddinWizard for Revit 2019 and Windows 10? I tried to do this my self, but could not get it to work. The Zip for Windows utility is not updated for Windows 10.

How to test this samples?

Hi, Jeremytammik

I'm new to RevitAPI and this project.
I tried to get the result with the image but I could do like you.
Could you tell me the steps in detail? I want you to give me exact steps like followings.

  1. Clone this project
  2. Add to add-in folder
    ...
    I don't know the steps,

Really looking forward to hear from you.

Best Regards

Jay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.