News:

Please note new Forum URL: forum.designcad.com

Main Menu

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.

Nicolas79

Hello, I'm from france.  ;)
excuse for my english.

do you have a macro wich copy properties like autocad.
color, layer, line type, line scale, .....


thank you.

Rob S


Bonjour

We have the "Same-as" finger in the info box.

Select the objects you want to change, bring up info box, click the finger, and point to the object whose properties you would like to copy.

Je parle un peu de francais, if you need translation!!!
User since forever

Nicolas79

Yes, i see it,
but this "finger" don't copy the layer.

in basicad, I need the instruction which get an entity whith the mouse.

Rob S


I see the info box "finger" does not pick up layer info. 

You can of course pick (select) any number of entities, and change their layer manually using the top row of the info box.

You can also do this in the "layer" toolbar, which has a same-as finger in it which does pick up the layer information from the object you point to, and applies it to all selected objects.

If neither of these is what you want, can you be a bit more clear what you want to accomplish?
User since forever

DrollTroll

Are you looking for something like this?


'GetObjectProps.d3m
' Obtains layer, linetype, linescale, linewidth, color of object picked by user,
' and makes those properties current.

' Clear selection (if any)'
Sys(80) = 0

PickIt:
>PointSelect
{
  <Incomplete
  <Prompt "Pick an object..."
}
If Sys(80) < 1 Then
Message "Nothing Selected. Try again, please."
Goto PickIt
End If

GetSelect 1, entid

Entity EntID

laynum = Sys(93) ' picked entity's layer number'
ltype = Sys(91)  ' picked entity's linetype'
lscale = Sys(97) ' picked entity's linetype scale '
lwid = Sys(98)   ' picked entity's linewidth'
red = Sys(290)   ' picked entity's red value'
green = Sys(291) ' picked entity's green value'
blue = Sys(292)  ' picked entity's blue value'

'Make settings current
Sys(3) = laynum
Sys(4) = ltype
Sys(5) = lscale
Sys(6) = lwid
Sys(300) = red
Sys(301) = green
Sys(302) = blue

Regen

End

25 years with DesignCAD

Dr PR

Rob and DT,

I'm not sure I want the "finger" to change layers. I use layers for different assemblies and subassemblies, and not to enforce some arbitrary line/color type to objects (something that I find to be totally counterproductive). It would be VERY bad to have parts switch between assemblies when they are "fingered." This would make it necessary to create "dummy" objects, assign properties to them with the "finger", then move the objects with the desired properties to another layer to transfer those properties to objects on the new layer.

This would be so much unproductive work that the "finger" would be useless!
DesignCAD user since 1987

DrollTroll

Sounds like we're heading dangerously toward finger-options...

Layer? Linestyle? Color? Material? Dimension Properties(if so, which ones)? Fries with that? Super-size it? Dessert?  ;D
25 years with DesignCAD

Wahoo!

Quote from: DrollTroll on April 01, 2008, 11:52:28 AM
Sounds like we're heading dangerously toward finger-options...

Layer? Linestyle? Color? Material? Dimension Properties(if so, which ones)? Fries with that? Super-size it? Dessert?  ;D

What's so hard about having options??  Should have been there anyway.  Right now I never know what the "same as" finger will "same as".

Rob S

#8
Finger options would be nice, but should wait til the group index issue is fixed, along with a few others previously reported. (dimensions, workspace, shifting layouts, ..)

On the other hand, an update to the Macros Help with all of the V18 stuff would allow those with specialized needs to help themselves, or be helped here on the forum.
User since forever

Nicolas79

Quote from: Rob Schippers on April 01, 2008, 07:42:42 AM

If neither of these is what you want, can you be a bit more clear what you want to accomplish?


I want to get the properties of one entitie and copy the properties to others entities.

the DrollTroll macro is a good begining.

I search too but the basicad langage is hard.

Rob S


It seems to me the only ways to currently copy layer info with the program interface is:

a)  to use the layer toolbar, use the finger there to make the layer of the object current, and then apply that layer to the selection,

b) if you know what layer it is, apply it within the info box after using the finger to get the rest of the properties.

As to DT's macro, it gathers the information for a few specific properties from the object you point to, and makes them current for objects you are about to draw including layer.

Now, we would need to add a routine where it applies these properties to all selected objects, which is possible.

However, there are about a million other properties, especially when it comes to dimensions, which could come into play, so it would be necessary to know exactly what kinds of objects you want it for, and what properties you want to copy every time.
User since forever

prl

Maybe on the previous forum, I posted a "sameas" basiccad routine.  This could be a start for those who need customized "same as" routines.  I also posted a routine that would invoke the "finger" via ole program which could be hotkeyed.  Not sure how much is still working in version 18, but rather than having the programmers create this new feature, I would argue this is something the users could contribute (me) if basiccad was on par with the rest of version 18.  Go for the GOLD (BasicCAD). :)


Rob S


Hey prl, would you find time to see if you can locate your masterpiece?

I might be able to do some updating for V18.0, if I have a starting point.
User since forever

prl

Here is the version I use now.  Keep in mind I'm a presetpoint guy. I've overloaded the program with some of my preferences depending on whether I've already selected something or not.  I think the key code you are looking for is toward the bottom.  Here is where you can decide which properties will become part of the "same as" routine.  You'll have to eliminate the "SendUpdateMsg.exe" lines, this is my way of having DesignCAD send an event message to my other OLE programs.


'Same as macro sa.d3m

'Modified on October 7, 2006
'
'notes - added three behaviors
'   1.  set a single point on something and the active layer changes to that layer
'   2.  set several points without selecting and the first n-1 points select and the nth point is
'       the destination.
'   3.  preselect several items and a single point defines the destination.

include "dcadalias.d3i"

Dim ent(5000)

sys(36) = 1

nent = sys(1)

'this routine added to toggle layer to selected item if nothing is used to match against
if sys(1) = 1 then
  if sys(80)=0 then
    >PointSelect
     {
     <Type 0
     <Usepresetpoints
     }
    getselect 1, a
    Entity a
    sys(3)=sys(93)
    sys(1)=0
    sys(80)=0
    run "SendUpdateMsg.exe"
    end
  end if
endif

'if items are selected, then only use one point for destination
if sys(80)>0 then
pointval xmatch, ymatch, zmatch, 1
sys(1) = 0
goto here
end if

'if more than two points are set, use this selection routine
nselpoints = nent - 1
if sys(1) > 1 then
   for j = 1 to nselpoints
      pointval x y z j
      >PointSelect
        {   
        <Type 1
        <Pointxyz [x, y, z]
        }
   next j
endif
pointval xmatch, ymatch, zmatch, nent

here:
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

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

'get data for destination
getselect 1, a
Entity a
lt=sys(91)
lay=sys(93)
ltscale=sys(97)
nametag$=sys$(300) 'added for v16+
redval= sys(290)
greenval = sys(291)
blueval = sys(292)
 
'reselect initial selection set
for j = 1 to maxsel
  entity ent(j) 'added for v16+
  sys$(300) = nametag$ 'added for v16+
  change Ent_Layer, lay
  change Ent_LineType, lt
  change Ent_LineScale, ltscale
  change Ent_Color, redval, greenval, blueval
  change Ent_ColorByLayer, 1
  'update
next j

sys(80)=0
sys(1)=0
sys(36) = 0
regen
run "SendUpdateMsg.exe"
END

Rob S


That's great, looks promising.

All I need now is some spare time!!!
User since forever