News:

Please note new Forum URL: forum.designcad.com

Main Menu

Info box SameAs utility

Started by prl, December 07, 2006, 11:42:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prl

I made this utility for someone else but find myself using it regularly too.  What it does it lets you activate the info box sameas finger icon without having to open the info box.  Simply select something and run the program.  It's most handy if you assign it to a hotkey or user toolbar.  Should work with versions 15.x, 16.x or 17.x

InfoSameAs.zip


cheers

bdeck


jdi000

Quote from: prl on December 07, 2006, 11:42:06 AM
I made this utility for someone else but find myself using it regularly too.  What it does it lets you activate the info box sameas finger icon without having to open the info box.  Simply select something and run the program.  It's most handy if you assign it to a hotkey or user toolbar.  Should work with versions 15.x, 16.x or 17.x

InfoSameAs.zip


Hi, prl

Can you repost the macro?


Thanks

Jason


cheers

impulse

PRL kindly wrote & posted that routine at my request a good while ago.
I can confirm that it works with v18 as well. It is not a Macro but rather a compiled executeable made using the OLE interface for Dcad. You can put it in any directory, but you have to make sure that the PATH to it is recognized.
As PRL suggested, it is most effective if assigned to a Keystroke or a HotMenu icon.

To use it...
-Select the item you wish to change.
-issue the command
-Select the Reference item that has the properties that are desired.

You will want to do a few tests that show what is affected IE: It does NOT change Layer, TextType or rotation. It DOES change color and Text Size


I use it every time I fire up DCAD
Thanks, once again, to PRL

JJG

#4
I confirm too that it works with v18 as well,
but, yesterday I was trying it in V19, and it do not work : is it the same issue for other users of V19, or have something changed in Infobox V19 ? (adress of sameas button, ... ?)

It's anyway very usefull in V18. Thank's !

JJG

I rectifie my remark above : it works with v19 as well too ! (it was just a problem of updating of toolboox)

Thanks, once again, to PRL (and to Impulse for download possibility)

Nicolas79

Hello,

This utility is great.
but I need to have it with layer change.

someone has the code for edit it?


thank you.

impulse

PRL has not posted here in a long time and since he used to be one of the most prolific members, I would speculate that he has moved on to a different CAD program or else where.
Would a basicCad that operated similarly, but acted ONLY on layers be of any use? That shouldnt be too hard to do. I probably have a Basicad that is close to that.

impulse 

Nicolas79

I've got this basicad macro:
http://forum.designcad.com/index.php?topic=1163.0

but when I change it for arrows, text, hatch,
it not works.

Lar

I have a 6 macro set: one copies all properties from one entity to another (layer, color, linestyle, fixed lineweight), one does color only, another layer only, another linestyle & weight, one does layer and color and the last you can set the fixed lineweight by inputting a number (rather than using the info box and the many clicks required). I don't have time to upload them now but I will later today, unless someone beats me to it.

Lar

Dr PR

Lar,

Do these macros experience the same time delay as opening the Info Box does? If not, they could be extremely useful. I use the Info Box primarily for two things, changing layers and changing color to match something else. Having to wait minutes for the Info Box to open (with large selections) is one of the most annoying problems in DesignCAD.

Phil
DesignCAD user since 1987

Lar

#11
**Note: I will copy this post in it's own thread in User Contributions...**

They are pretty much instantaneous, Doc (Dr. Phil, is it) but I never used them on a big bunch of entities at once. Normally it's just for a single entity or a group.

Note that these are for copying properties from existing entities to other existing entities.

I split the set into different macros to avoid the user having to respond to messages so they ask no questions and report no data, just make changes. You have to know what layer the entity is on beforehand.

I have them in their own toolbox so a max of 3 clicks will get the job done: #1 to select the 'target' entity to change, if it isn't already; #2 in the toolbox for the macro; #3 to select the 'source' entity to get the properties from. The first 'target' gets reselected automatically.

I just added a bunch of notes in the first macro for the sake of you forum guys. Please read and make adjustments to all the macros to suit your own needs. These notes will not appear during the running of the macro (as they are now written).


'Copy All Entity Properties.d3m
'by Lar, Nassau, Bahamas
'created around Jan 2006

'INSTRUCTIONS: 1] Select target entity(s), 2] start macro, 3] select source entity...   The Layer, Color, Linestyle and Fixed Lineweight will be copied to the 1st entity(s) ['the target']

'IMPORTANT:
'If regenerating would slow down your system then add an apostrophe (') at the start of the last line of this macro but you may not see the change until the screen refreshes (the entity WILL be changed, though)...
'......If your Info Box is slow then close it before running the macro so it doesn't have to repopulate the new data for the target entity.

'IMPORTANT:
'You can remove the apostrophe from the 'message' line if you want to be prompted...

'If a group or solid is the source then parameters of the 1st entity (in dcad's id list) of that group will be used...

'If the source has 'Color/Linestyle by Layer' activated the target will take these properties but the 'by layer' status of the source will not change (the target will end up looking like how the target looks), except as in the notes below...

'If the target has 'Color/Linestyle by Layer' activated you will not see the change until you deactivate these settings...

'Note that there are a wide range of possibilities that can result depending on the exact 'by Layer' settings of the source, the target, and which properties you are changing...

'IMPORTANT:
'IMPORTANT:
'IMPORTANT: revise the two 'include' lines below to suit the location of your  dcacalias.d3i file...


'Include "*\dcadalias.d3i"
Include "c:\macros\dcadalias.d3i"

if sys(80)=0 then
message "Sorry, Entities to Change must be selected already. Select Entities then restart macro..."
end
end if

NumSel=sys(80)   'number of entities selected...

dim ent(NumSel)

for ee=1 to NumSel
getselect ee, ent(ee)
next ee

'message "Click on the Entity to Copy All standard properties from..."

>PointSelect
{
}

GetSelect 1, e2nd
Entity e2nd

Query Ent_Layer, elayer
Query Ent_Color, redval, greenval, blueval
Query Ent_Linetype, eltype
Query Ent_LineScale, eltypescale
Query Ent_LineWidth, elwidth
Query Ent_LineFill, elfilled
Query Ent_LineWeight, elweight
Query Ent_FixedWidth, elfixed

sys(80)=0  'deselect everything...

for eee=1 to NumSel
Entity ent(eee)

Change Ent_Layer, elayer
Change Ent_Color, redval, greenval, blueval
Change Ent_Linetype, eltype
Change Ent_LineScale, eltypescale
Change Ent_LineWidth, elwidth
Change Ent_LineFill, elfilled
Change Ent_LineWeight, elweight
Change Ent_FixedWidth, elfixed

Update

'reselect original entities...
GETATTR ent(eee), type ,select
select=1
PUTATTR ent(eee), type ,select

next eee

regen    'regenerate screen




'Copy Entity Color.d3m
'by Lar, Nassau, Bahamas
'created: 22 Jan 2006
'revised 24 May 2007: turn off message telling user to click on entity whose color to copy


'Include "*\dcadalias.d3i"
Include "c:\macros\dcadalias.d3i"

if sys(80)=0 then
message "Sorry, Entities to Change must be selected already. Select Entities then restart macro..."
end
end if

NumSel=sys(80)   'number of entities selected...

dim ent(NumSel)

for ee=1 to NumSel
getselect ee, ent(ee)
next ee

'message "Click on the Entity to Copy Color from..."

>PointSelect
{
}

GetSelect 1, e2nd
Entity e2nd

Query Ent_Color, redval, greenval, blueval

sys(80)=0  'deselect everything...

for eee=1 to NumSel
Entity ent(eee)

Change Ent_Color, redval, greenval, blueval

Update

'reselect original entities...
GETATTR ent(eee), type ,select
select=1
PUTATTR ent(eee), type ,select


next 'eee

regen    'regenerate screen



'Copy Entity Layer.d3m
'by Lar, Nassau, Bahamas
'created: 22 Jan 2006
'revised 24 May 2007: turn off message telling user to click on entity whose layer to copy

'Include "*\dcadalias.d3i"
Include "c:\macros\dcadalias.d3i"

if sys(80)=0 then
message "Sorry, Entities to Change must be selected already. Select Entities then restart macro..."
end
end if

NumSel=sys(80)   'number of entities selected...

dim ent(NumSel)

for ee=1 to NumSel
getselect ee, ent(ee)
next ee

'message "Click on the Entity to Copy Layer from..."

>PointSelect
{
}


GetSelect 1, e2nd
Entity e2nd

Query Ent_Layer, elayer

sys(80)=0  'deselect everything...

for eee=1 to NumSel
Entity ent(eee)

Change Ent_Layer, elayer

Update

'reselect original entities...
GETATTR ent(eee), type ,select
select=1
PUTATTR ent(eee), type ,select

next eee

regen    'regenerate screen



'Copy Entity Linestyle.d3m
'by Lar, Nassau, Bahamas
'created: 22 Jan 2006
'revised 24 May 2007: turn off message telling user to click on entity whose linestyle to copy

'Include "*\dcadalias.d3i"
Include "c:\macros\dcadalias.d3i"

if sys(80)=0 then
message "Sorry, Entities to Change must be selected already. Select Entities then restart macro..."
end
end if

NumSel=sys(80)   'number of entities selected...

dim ent(NumSel)

for ee=1 to NumSel
getselect ee, ent(ee)
next ee

'message "Click on the Entity to Copy Linestyle from..."

>PointSelect
{
}

GetSelect 1, e2nd
Entity e2nd


Query Ent_Linetype, eltype
Query Ent_LineScale, eltypescale
Query Ent_LineWidth, elwidth
Query Ent_LineFill, elfilled
Query Ent_LineWeight, elweight
Query Ent_FixedWidth, elfixed

sys(80)=0  'deselect everything...

for eee=1 to NumSel
Entity ent(eee)

Change Ent_Linetype, eltype
Change Ent_LineScale, eltypescale
Change Ent_LineWidth, elwidth
Change Ent_LineFill, elfilled
Change Ent_LineWeight, elweight
Change Ent_FixedWidth, elfixed

Update

'reselect original entities...
GETATTR ent(eee), type ,select
select=1
PUTATTR ent(eee), type ,select


next eee

regen    'regenerate screen



'Change Fixed Lineweight.d3m
'by Lar,
'Nassau, Bahamas
'created: 22 Jan 2006


'Include "*\dcadalias.d3i"

Include "C:\Macros\dcadalias.d3i"

if sys(80)=0 then
message "Sorry, Entities to Change must be selected already. Select Entities then restart macro..."
end
end if

NumSel=sys(80)   'number of entities selected...

dim ent(NumSel)

for ee=1 to NumSel
getselect ee, ent(ee)
next ee

elweight=40
input "Enter New Fixed Weight (def=40; [some examples: 0,5,9,15,20,30,40,50,60,80, 100, 140, 200] ..." elweight
if sys(999) then end
'sys(80)=0  'deselect everything...

if elweight=0 then elfixed=0
if elweight<>0 then elfixed=1

for eee=1 to NumSel
Entity ent(eee)

Change Ent_LineWeight, elweight
Change Ent_FixedWidth, elfixed
'Change Ent_LineFill, elfilled

Update

'reselect original entities...
GETATTR ent(eee), type ,select
select=1
PUTATTR ent(eee), type ,select

next eee

regen    'regenerate screen



'Copy Entity Layer & Color.d3m
'by Lar,
'Nassau, Bahamas
'created: 22 Jan 2006
'revised 24 May 2007: turn off message telling user to click on entity whose layer to copy

'Include "*\dcadalias.d3i"
Include "c:\macros\dcadalias.d3i"

if sys(80)=0 then
message "Sorry, Entities to Change must be selected already. Select Entities then restart macro..."
end
end if

NumSel=sys(80)   'number of entities selected...

dim ent(NumSel)

for ee=1 to NumSel
getselect ee, ent(ee)
next ee

'message "Click on the Entity to Copy Layer from..."

>PointSelect
{
}


GetSelect 1, e2nd
Entity e2nd

Query Ent_Layer, elayer
Query Ent_Color, redval, greenval, blueval

sys(80)=0  'deselect everything...

for eee=1 to NumSel
Entity ent(eee)

Change Ent_Layer, elayer
Update

Change Ent_Color, redval, greenval, blueval
Update

'reselect original entities...
GETATTR ent(eee), type ,select
select=1
PUTATTR ent(eee), type ,select

next eee

regen    'regenerate screen



Lar

JJG

OK : Here's another way to run the sameas-finger of the infobox :

Because I had some troubles with my Windows XP machine 6 months ago (I've repaired since !), the sameas.exe file from PRL don't wanted boot up anymore, what bothered me a lot in my work.
Also, I tried to find a way to do the same thing, but only in macro language, ... and I found it !

In fact, the native command to activate the finger sameAs already exists in the file Dc3MaxCmd.INI, but it is rendered inaccessible (= disabled) by simply being put in comment : it is ID_INFO_SAMEASBAR = 10673

Dc3MaxCmd.ini file can be found ordinary in C:\Program Files\IMSIDesign\DesignCAD 3D Max 19

So, to active the command again, the ";" placed just before must be removed, then further in the file, it is necessary to create a specific line " C10673 = ID_INFO_SAMEASBAR ", at the right place, that is to say in strict alphanumeric order ! (otherwise, the following commands in the list will be ignored)
The command becomes usable in macro form:

   > ID_INFO_SAMEASBAR
   {
   }
   
but one can also create a specific command name for it in the file custom.ini, eg "fingerinfobox";
For this, simply add the line " fingerinfobox = ID_INFO_SAMEASBAR " to this file custom.ini
restart the computer if DesignCAD has been launched before any changes to these files in the Windows session.

For a better security of use, a test (to check that something is previously selected) can be added.


'JJG oct. 2010
'macro using a command specifically re-activated in Dc3MaxCmd.ini file, whereas it was disabled by being put in comment.
'it is ID_INFO_SAMEASBAR = 10673
'( Dc3MaxCmd.ini file conventionaly can be found in C:\Program Files\IMSIDesign\DesignCAD 3D Max 19 )
'So, to active the command again, the ";"  before must be removed, then further in the file,
'a specific line C10673 = ID_INFO_SAMEASBAR must be created at the right place,
'that is to say in strict alphanumeric order ! (otherwise, the following commands in the list will be ignored)
'The command becomes usable in macro form:
   '
   '> ID_INFO_SAMEASBAR
   '{
   '}
   '
'but one can also create a specific command name for it in the file custom.ini, eg "fingerinfobox";
'For this, simply add the line fingerinfobox = ID_INFO_SAMEASBAR to this file custom.ini
'restart the computer if DesignCAD has been launched before any changes to these files in the Windows session.


debut:
If sys(80)<1 then goto fin

>fingerinfobox
{
  }
End

fin:
inf$="please select something before running this macro ... !"
message inf$
End


JJG

I would add that this other way to launch the sameAs-finger is faster than the sameas executable file.

bdeck

#14
Quote from: JJG
Here's another way to run the sameas-finger of the infobox

Hello JJG,

Very cool. Thanks for the post.

A macro assigned to a hotkey works great.

bd