copy properties like autocad

Started by Nicolas79, March 31, 2008, 08:38:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prl

In searching, I found this post by Impulse.  It has the better basiccad solution, although only a wish at this point.


QuotePosted - 08/16/2006 :  08:31:10 AM   Show Profile   Email Poster
I would like a way to call up the routine associated with the "SAME AS" (finger icon) of the INFOBOX.
It doesnt necessarily have to be done in Basicad/OLE, but it would be nice to be able to have this function attached to a hotkey.
Perhaps this has already been implemented in v17, I've not yet bought my ticket to that Drama.

Sure we can now implement something like this using a bunch of code and the Query/Change Statement, but its already written....we just need access.

Of course were it to implemented in basicad it might look something like this...

>SameAs
{
' for all parameters m = 0 dont match this parameter, m = 1 match this parameter
<color m
<Linetype m
<Linestyle m
<Linescale m
<Font m
<Textsize m
<Layer m
}

and so on....hopefully the routine would do the necessary error checking that would keep us from crashing when we tried to match the LineStyle between a Line entity and Text, but still apply the relavent parameters such as color or layer.

I could be happy with just hot key access to the existing command

IMPULSE

Nicolas79

In france, we have designcad 6000 (like V.15)
somes functions not run like UsePresetPoints

I want only color, layer, linetype, linescale, line thickness,
other properties are less important.

the finger is best,
but I want ONE function in my perso toolbar for the same results.


prl

#17
Quote from: Nicolas79 on April 03, 2008, 02:33:36 AM
I want only color, layer, linetype, linescale, line thickness,

Here is a simpler "same as" routine, see if this works for you. It only does the things you listed above.

'Program: ssa.d3m (Simple SameAs)

' tested w/version 15 and higher

include "dcadalias.d3i"

Dim ent(5000)

sys(1) = 0

if sys(80)=0 then
  Message "Nothing selected. . . press any key to continue"
  END
end if

maxsel= Sys(80)
If maxsel > 5000 Then maxsel = 5000

For j = 1 To maxsel
  Getselect j, ent(j) 'get entity numbers and store in array
Next j

sys(80)=0   

setpoint "set a point on entity to match properties", 1

if sys(1) > 0 then
  pointval xmatch, ymatch, zmatch, 1
else
Message "nothing to match to, exiting routing"
end
endif
sys(36) = 1
sys(80)=0

>PointSelect
{   
<Type 1
<Pointxyz [xmatch, ymatch, zmatch]
}

'get data for destination
getselect 1, a
Entity a
query Ent_Color, redval, greenval, blueval
query Ent_Layer, lay
query Ent_LineType, lt
query Ent_LineScale, ltscale
query Ent_LineWeight, elweight
query Ent_FixedWidth, elfixed


 
'reselect initial selection set
for j = 1 to maxsel
  entity ent(j)
  change Ent_Color, redval, greenval, blueval
  change Ent_Layer, lay
  change Ent_LineType, lt
  change Ent_LineScale, ltscale
  change  Ent_LineWeight, elweight
  change  Ent_FixedWidth, elfixed
  'update
next j

sys(80)=0
sys(1)=0
sys(36) = 0
regen
END


If this works, create a hotkey or a custom tool bar icon for it.