Load Google Translate I have the following ULP code that fails to return any objects for the
ingroup() function in Eagle 6. Is this a bug or has something changed?
SCH.parts(P)
{
if (ingroup(P))
{
// make sure it has a package and name
if (P.device.package && P.name)
{
string disp;
if (fDisplay == 0)
disp = "OFF";
else if (fDisplay == 1)
disp = "VALUE";
else
disp = "NAME";
string tmp;
sprintf(tmp, "CHANGE DISPLAY %s;\n", disp);
strCmd += tmp;
sprintf(tmp, "ATTRIBUTE %s %s '%s';\n", P.name,
strAttrName, strAttrValue);
strCmd += tmp;
//dlgMessageBox(strCmd);
++cnt;
}
}
Thanks!
Bob Starr
I have the same problem!
Günther
On 01/11/12 19:31, Bob Starr wrote:
I have the following ULP code that fails to return any objects for the
ingroup() function in Eagle 6. Is this a bug or has something changed?
This is a bug, honestly.
Implemented this way, it also didn't work in Version 5.
In Version 5 you have to go over the sheet context, like:
SCH.sheets(SH)
SH.parts(P)
if (ingroup(P))
dlgMessageBox("Part in group: " + P.name);
We'll repair this.
Regards,
Walter Spermann
SCH.parts(P)
{
if (ingroup(P))
{
// make sure it has a package and name
if (P.device.package && P.name)
{
string disp;
if (fDisplay == 0)
disp = "OFF";
else if (fDisplay == 1)
disp = "VALUE";
else
disp = "NAME";
string tmp;
sprintf(tmp, "CHANGE DISPLAY %s;\n", disp);
strCmd += tmp;
sprintf(tmp, "ATTRIBUTE %s %s '%s';\n", P.name,
strAttrName, strAttrValue);
strCmd += tmp;
//dlgMessageBox(strCmd);
++cnt;
}
}
Thanks!
Bob Starr
--
-
Walter Spermann
Softwareentwicklung
CadSoft Computer GmbH
Pleidolfweg 15
84568 Pleiskirchen
Tel.: 08635/6989-10
www.cadsoft.de
-
Registergericht: Amtsgericht Traunstein HRB 5573
Geschäftsführer: Thomas Liratsch
-
On 1/20/2012 9:13 AM, Walter Spermann wrote:
On 01/11/12 19:31, Bob Starr wrote:
>> I have the following ULP code that fails to return any objects for the
>> ingroup() function in Eagle 6. Is this a bug or has something changed?
This is a bug, honestly.
Implemented this way, it also didn't work in Version 5.
In Version 5 you have to go over the sheet context, like:
SCH.sheets(SH)
SH.parts(P)
if (ingroup(P))
dlgMessageBox("Part in group: " + P.name);
We'll repair this.
Hi Walter,
Not sure I follow you on the above. My original ULP's work fine in v5.11
with the following logic.
SCH.parts(P)
{
if (ingroup(P))
{
}
}
What happens if the SCH.sheets enum is not used, does it use the current
sheet being edited in the schematic?
FWIW, I've tried both methods with v6 of Eagle and neither returns any
results for ingroup(). I have a number of ULP's that use the ingroup()
function that I use daily in my work, so I've not moved to v6 yet. Any
idea when this might be addressed?
Regards,
Bob
On 02/08/12 17:01, Bob Starr wrote:
On 1/20/2012 9:13 AM, Walter Spermann wrote:
>> On 01/11/12 19:31, Bob Starr wrote:
>>> I have the following ULP code that fails to return any objects for the
>>> ingroup() function in Eagle 6. Is this a bug or has something changed?
>> This is a bug, honestly.
>> Implemented this way, it also didn't work in Version 5.
>> In Version 5 you have to go over the sheet context, like:
>>
>> SCH.sheets(SH)
>> SH.parts(P)
>> if (ingroup(P))
>> dlgMessageBox("Part in group: " + P.name);
>>
>> We'll repair this.
Hi Walter,
Not sure I follow you on the above. My original ULP's work fine in v5.11
with the following logic.
SCH.parts(P)
{
if (ingroup(P))
{
}
}
What happens if the SCH.sheets enum is not used, does it use the current
sheet being edited in the schematic?
Yes. Obviously if all instances are on one sheet and if all these instances are in a
group this works (ingroup is true then). This is a grey zone a bit.
We have to make this straight and clear again.
FWIW, I've tried both methods with v6 of Eagle and neither returns any
results for ingroup(). I have a number of ULP's that use the ingroup()
function that I use daily in my work, so I've not moved to v6 yet. Any
idea when this might be addressed?
In one of the next betas. I can't say exactly because we still have a number of
other issues to fix. Sorry for that.
Regards,
Walter Spermann
Regards,
Bob
--
-
Walter Spermann
Softwareentwicklung
CadSoft Computer GmbH
Pleidolfweg 15
84568 Pleiskirchen
Tel.: 08635/6989-10
www.cadsoft.de
-
Registergericht: Amtsgericht Traunstein HRB 5573
Geschäftsführer: Thomas Liratsch
-
On 2/8/2012 4:28 PM, Walter Spermann wrote:
On 02/08/12 17:01, Bob Starr wrote:
>> On 1/20/2012 9:13 AM, Walter Spermann wrote:
>>> On 01/11/12 19:31, Bob Starr wrote:
>>>> I have the following ULP code that fails to return any objects for the
>>>> ingroup() function in Eagle 6. Is this a bug or has something changed?
>>> This is a bug, honestly.
>>> Implemented this way, it also didn't work in Version 5.
>>> In Version 5 you have to go over the sheet context, like:
>>>
>>> SCH.sheets(SH)
>>> SH.parts(P)
>>> if (ingroup(P))
>>> dlgMessageBox("Part in group: " + P.name);
>>>
>>> We'll repair this.
>>
>> Hi Walter,
>>
>> Not sure I follow you on the above. My original ULP's work fine in v5.11
>> with the following logic.
>>
>> SCH.parts(P)
>> {
>> if (ingroup(P))
>> {
>> }
>> }
>>
>> What happens if the SCH.sheets enum is not used, does it use the current
>> sheet being edited in the schematic?
Yes. Obviously if all instances are on one sheet and if all these instances are in a
group this works (ingroup is true then). This is a grey zone a bit.
We have to make this straight and clear again.
>>
>> FWIW, I've tried both methods with v6 of Eagle and neither returns any
>> results for ingroup(). I have a number of ULP's that use the ingroup()
>> function that I use daily in my work, so I've not moved to v6 yet. Any
>> idea when this might be addressed?
In one of the next betas. I can't say exactly because we still have a number of
other issues to fix. Sorry for that.
Thanks Walter, I'll keep an eye out for ingroup() in the release notes,
sure would like to get this working again. I may have some other issues
affecting my BOM-EX bill of materials ULP that I'll have to sort out also.
Bob
Hi Bob,
On 01/11/12 19:31, Bob Starr wrote:
I have the following ULP code that fails to return any objects for the
ingroup() function in Eagle 6. Is this a bug or has something changed?
SCH.parts(P)
{
if (ingroup(P))
{
// make sure it has a package and name
if (P.device.package && P.name)
{
string disp;
if (fDisplay == 0)
disp = "OFF";
else if (fDisplay == 1)
disp = "VALUE";
else
disp = "NAME";
string tmp;
sprintf(tmp, "CHANGE DISPLAY %s;\n", disp);
strCmd += tmp;
sprintf(tmp, "ATTRIBUTE %s %s '%s';\n", P.name,
strAttrName, strAttrValue);
strCmd += tmp;
//dlgMessageBox(strCmd);
++cnt;
}
}
Thanks!
Bob Starr
we fixed some issues in this area, but actually,
the objects in the group are the instances, not the parts.
Please consider this approach:
SCH.parts(P)
P.instances(I)
if (ingroup(I))
dlgMessageBox("Part " + P.name + " has selected Instance " + I.name);
From V5 to V6 we changed the object hierarchy:
Instances are no longer children of the according part but of the sheet where they are located.
(this is like for all other objects that are located on a sheet).
Like in V5, if an object is in a group, also the parent entities are assigned to the group.
That's why the code
SCH.parts(P)
if (ingroup(P))
dlgMessageBox("Part " + P.name + "is in group");
doesn't work although you may have added some instances to a group.
The code
SCH.sheets(SH)
if (ingroup(SH)
SH.instances(I)
if (ingroup(I))
dlgMessageBox("Selected Instance " + I.name);
works, because the parent sheet is in the group, if one of it's instances is in the group.
To find out the parts related to instances in a group you have to use the first code snippet.
Sorry for the confusion ! The new object hierarchy is also described in the online help
(Section User Language/Object types). HTH.
Regards,
Walter
--
-
Walter Spermann
Softwareentwicklung
CadSoft Computer GmbH
Pleidolfweg 15
84568 Pleiskirchen
Tel.: 08635/6989-10
www.cadsoft.de
-
Registergericht: Amtsgericht Traunstein HRB 5573
Geschäftsführer: Thomas Liratsch
-
© 2009 Premier Farnell plc. All Rights Reserved
Premier Farnell plc, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE