From: john@sad.hp.com (John Ruf)
Subject: Re: Unused Symbol Pins in Design Architect
Date: Mon, 11 Jan 1993 17:49:38 GMT
Organization: HP Sonoma County (SRSD/MWTD/MID)
X-Newsreader: TIN [version 1.1.4 PL6]

Jeff Szczepanski (szczepan@dtc.kodak.com) wrote:
: Has anybody found a way to create a component in Design Architect that can be
: used to connect to unused pins on other symbols. This would be done to prevent
: pins that I don't want connected to anything from being flagged as 
: "Instance has unconnected pins...." warnings in "Check Sheet".
: 
: I am aware of the CLASS=dangle property for pins, but this is too much of a hassle
: and too error prone, besides being graphically unfriendly.
: 
: Any help or suggestions would be greatly appreciated. 
: 
: Thanks,
: 
: Jeff

  Here is a way to do it that takes the hassle out of it (for the users at
least). You will need to learn a little bit about AMPLE and loading userware
to get this to work, and you may also want to create a simple way to access
this command (register it and give it a short command alias, put it on the
palette menu with an icon, create a stroke, etc.). We have this accessed by
a palette icon here.
  This function should be placed in a file called "schematic.ample" and should
be found by the AMPLE_PATH env variable (See the AMPLE users manual for more
details or call your Mentor support).

------------------------------------------------------------------------------

function add_ncnet()
	// This function lets you terminate pins that you want to leave
	// unconnected on a schematic. The function lets you add a net to the
	// desired pin, then attaches a CLASS - DANGLE property to tell Mentor
	// that you mean to leave it unconnected. It then attaches a net name
	// (PCB_NET) of NC for visual documentation of the Not Connected net.
	// The properties are placed and justified nicely based on the
	// direction of the last segment of the net you added.
{
  local netnameposX;
  local netnameposY;
  local hjust;

  while (@true) {		// loop infinite
    $unselect_all(@comment,@frame,@instance,@pin,@property,@symbolpin,@text,@vertex);
    $add_net();
    $freeze_window();		// makes it faster
	// Find last segment of the added net and determine position and
	// justification of the properties.
    local handles = $get_select_handles();
    local numpts = length(handles);
    local lastpt = $get_vertex_attributes(handles[numpts-1],@location)[0];
    local prevpt = $get_vertex_attributes(handles[numpts-2],@location)[0];
    if (lastpt[0] > prevpt[0]) {
      netnameposX = lastpt[0] + .05;
      netnameposY = lastpt[1];
      hjust = @left;
    }
    else if (lastpt[0] < prevpt[0]) {
      netnameposX = lastpt[0] - .05;
      netnameposY = lastpt[1];
      hjust = @right;
    }
    else if (lastpt[1] > prevpt[1]) {
      netnameposX = lastpt[0];
      netnameposY = lastpt[1] + .1;
      hjust = @center;
    }
    else {
      netnameposX = lastpt[0];
      netnameposY = lastpt[1] - .1;
      hjust = @center;
    }
    $unselect_all(@comment,@frame,@instance,@pin,@property,@symbolpin,@text,@vertex);
	// Add the properties to the net
    $select_by_handle(@noview,handles[numpts-1]);
    $add_property("PCB_NET","NC",[netnameposX,netnameposY]);
    $add_property("CLASS","DANGLE",[netnameposX,netnameposY]);
    $change_property_justification("PCB_NET",@center,hjust);
    $change_property_justification("CLASS",@center,hjust);
    $change_property_visibility("CLASS",@hidden);
    $unfreeze_window(@force);
  }
}