How to retrieve instance parameters from an uninstantiated (uninserted) family

The trick to be able to read the default values for instance parameters is to get to the FamilyManager.
The family manager is a whole separate area of the API, with separate classes for FamilyType and FamilyParameter. You can think of it as the API version of the Family Types dialog in the Family Editor.
Getting there involves opening the family as a document, something along the lines of:

 
if (ColFam.IsEditable)
{
   Document familyDoc = mainDocument.EditFamily( ColFam );
   FamilyManager manager = familyDoc.FamilyManager;

  foreach (FamilyParameter fp in manager.Parameters )
  {
      // over simplified, but hopefully you get the idea....
      if (fp.IsInstance)
       {
           string instanceValue = manager.CurrentType.AsString( fp );
        }
  }

   // don‘t forget to close the family when you‘re done.
   familyDoc.Close(false);
}
时间: 2024-10-18 15:05:48

How to retrieve instance parameters from an uninstantiated (uninserted) family的相关文章

Behavior trees for AI: How they work

http://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php by Chris Simpson on 07/17/14 09:35:00 pm       27 comments       The following blog post, unless otherwise noted, was written by a member of Gamasutra

PHP-redis英文文档

作为程序员,看英文文档是必备技能,所以尽量还是多看英文版的^^ PhpRedis The phpredis extension provides an API for communicating with the Redis key-value store. It is released under the PHP License, version 3.01. This code has been developed and maintained by Owlient from November

Retrieving data from a server

A system includes a server and a controller embedded in a device. Both the server and the embedded controller are capable of communicating over a computer network. The embedded controller sends a command to the server over the computer network that i

python 调用mysql存储过程返回结果集

存储过程: delimiter | create procedure get_product_info(in imid int(10),int iuser varchar(20)) begin select * from tb_test where mid = imid and user = iuser; end; | delimiter ; python调用: import mysql.connector cnx = mysql.connector.connect( user='test',p

Using Stored Programs with MySQLdb

http://flylib.com/books/en/1.142.1.125/1/ Using Stored Programs with MySQLdb The techniques for calling stored programs with MySQLdb differ only slightly from those for using traditional SQL statements. That is, we create a cursor, execute the SQL to

ORA_ERROR大全

转自:http://blog.csdn.net/haiross/article/details/12839229 常见错误:-60 ORA00060: deadlock detected while waiting for resource 一般错误:  - 1 ORA00001: unique constraint (.) violated  -17 ORA00017: session requested to set trace event  -18 ORA00018: maximum nu

Greenplum+Hadoop学习笔记-10-Greenplum安装

2.1.评估存储能力 2.1.1.计算可用的空间 步骤1:初始存储能力=硬盘大小*硬盘数 步骤2:配置RAID10,格式化磁盘空间=(初始存储能力*0.9)/2 步骤3:可用磁盘空间=格式化磁盘空间*0.7 步骤4:用户数据使用空间 使用镜像:(2*用户数据)+用户数据/3=可用磁盘空间 不使用镜像:用户数据+用户数据/3=可用磁盘空间 2.1.2.计算用户数据大小 平均来说,实际占用磁盘空间大小=用户数据*1.4 页面开销:32KB页面需要20 bytes 行开销:每行24 bytes,'ap

openstack中Nova组件servers的所有python API 汇总

Servers Server interface. class novaclient.v2.servers.Server(manager, info, loaded=False) Bases: novaclient.openstack.common.apiclient.base.Resource Populate and bind to a manager. Parameters: manager – BaseManager object info – dictionary representi

The template engine

Play has an efficient templating system which allows to dynamically generate HTML, XML, JSON or any text-based formatted document. The template engine uses Groovy as an expression language. A tag system allows you to create reusable functions. Templa