Jump to content

Hippocode

Member
  • Posts

    796
  • Joined

  • Last visited

Posts posted by Hippocode

  1. Just create an empty drawing with 2 objects; One with attributes by class and one forced attributes based on a fill. Export to vectorscript and tada!

    This will give you all you need to "change" the fill.

    Next, all you need is a foreach loop with criteria, there are a lot of existing topics on how to use those.

  2. You will need to provide a little more info what you exactly need.

    Where does this text come from ? A Vectorworks text object ? From clipboard ? An external file ?...

    Do you have the OpenType or Truetype font as a file ?

    You want in Vectorworks as a result a text block which uses the custom font ?

  3. Not sure what Kevin's suggestion is supposed to do.

    The custom selection group just allows you to customize the selection content which is highlighted when you select the object. This has nothing to do with object dimensions or insertion point.

    From what I understand you can still use the command you want to use, instead from calculating from the center, you do your calculations from the left bounding box. I don't think it will be any different from starting in the center.

  4. Maybe it depends on where/when you SET that variable. Where do you make the "set" call ?

    // Plugin insert selectors
    // ----------------													
    const short ovPluginInsertMode			= 123 ; 	// short - where to insert the symbol in the wall - Public for VS
    
    //const InsertModeType kPluginnsertOnCenter	= 0;	insert at the center of the wall
    //const InsertModeType kPluginInsertOnEdge	= 1; 	Symbol Defs do not distinguish between left and right.
    
    const short ovPluginBreakMode			= 124 ; 	// short, specifies how the wall is broken where the symbol is inserted - Public for VS
    
    //const BreakModeType kPluginFullBreakWithCaps = 1;	standard for most symbol insertions
    //const BreakModeType kPluginFullBreakNoCaps	= 2;	no cap lines, but the wall is broken
    //const BreakModeType kPluginHalfBreak			= 3; 	for edge insertion only;
    //const BreakModeType kPluginNoBreak			= 4;	no break in the wall		
    
    
    
    // Symbol definiton selectors
    // ----------------													
    const short ovSymDefInsertMode			= 125 ; 	// short - where to insert the symbol in the wall - Public for VS
    
    //const InsertModeType kSymInsertOnCenter	= 0;	insert at the center of the wall
    //const InsertModeType kSymInsertOnEdge		= 1; 	Symbol Defs do not distinguish between left and right.
    
    const short ovSymDefBreakMode			= 126 ; 	// short, specifies how the wall is broken where the symbol is inserted - Public for VS
    
    //const BreakModeType kSymFullBreakWithCaps = 1;	standard for most symbol insertions
    //const BreakModeType kSymFullBreakNoCaps	= 2;	no cap lines, but the wall is broken
    //const BreakModeType kSymHalfBreak			= 3; 	for edge insertion only;
    //const BreakModeType kSymNoBreak			= 4;	no break in the wall		
    
    const short ovSymbolInsertAsGroup		= 127 ;		// Boolean, whether to perform a Shallow Symbol to Group after insertion - Public for VS
    
    const short ovSymDefUseClass			= 128 ;     // Boolean, use the class of the symbol definition as the class for the new insert
    
    const short ovSymDefInsertIntoWalls		= 129 ;		// Boolean, allow or prevent wall insertion of symbols
    
    const short ovSymDefPageBased			= 130;		// Boolean - whether the symbol will have a constant page size, meaning it will have the same size
    												// on screen for different layer scales, and its world size will be different for different
    												// layer scales - Public for VS

  5. Finding out how native Vectorworks objects work can be a pain.

    If the stamp is really linked to an object, it must have saved the link somewhere.

    If lucky, this is in a (hidden) record attached to this object.

    I have a menu command available that lists all attached records of an object, including hidden/IFC records if turned on in the settings.

    http://www.hippocode.com/Extensio/menucommands/organisation-objects

  6. You need to create a for each loop that iterates all objects types that can have this record attached. Then, you look if that record format is attached to that object.

    The VS function reference has functions under "Database / Record" that give you records attached to an object, compare the name of those to your record format.

    Thank you hippothamus,

    but is the loop really the only way? I'm not so happy about it, because loops are rather slow - I was hoping that Vectorworks could identify directly the object with the record 'Billy'.

    I was hoping, that this is possible, because when you generate a list of records with a table in VW you can easily identify the referring object in the drawing by right-clicking the table entry. So Vectorworks seems to be able to 'find' objects with a record.

    Thanks for further help,

    VvierA

    It's faster then you'd think. A handle doesn't take so much load as it's small in size.

    Also, a worksheet does exactly what I described, the right click uses the handle it has on that object to select it. That handle is found by iterating all objects and looking for the criteria you provided.

    Even if there was such a function, the code behind that function would do the same, iterating objects :)

  7. How do I get a handle to the object by using the record 'Billy'?

    You need to create a for each loop that iterates all objects types that can have this record attached. Then, you look if that record format is attached to that object.

    The VS function reference has functions under "Database / Record" that give you records attached to an object, compare the name of those to your record format.

  8. Just curious, why is it that in a record format - if i enter a formula for say 30/5 = it prints out an answer, but if i try to reference the field, it doesn't modify it?

    Because that's just not available.

    A record field is just a parameter holding a value, nothing more. Some fields allows intern calculations but they are not aware of other fields.

    It would be a simple script, iterating all objects containing your record and do the math manually, save it in one of the fields.

  9. @MullinRJ

    Thank you.

    I thought about using an ID to link two objects together.

    But the downside is, that I do not know how to build an algorithm to generate and maintain unique IDs within Vectorscript.

    So I'd prefer a built-in routine to link to elements - if such a routine exists.

    I think every object has it's own index, an ID. It's not the same as the unique name string that can be found in the info palette.

    If you were to create a string, it's actually not so hard. Just a do while loop that creates a random string and checks to make sure such object does not exist, if it does it will continue looping for a new string..

    I have some code lying around that handles connecting object by placing a reference into a record attached to it, but it's made with the SDK so you can't do anything with it in vs :)

  10. Hello,

    I'd like to write a script to link to objects to one another.

    For example associate a symbol to a rectangle.

    The purpose is to get a handle to the other object, when modifying the other.

    Is there a way?

    Thanks for any help,

    VvierA

    P.S.

    I already found 'AddAssociation'

    but this doesn't seem to give me a handle. It just links to objects so that one element is deleted/ reset if the other one is deleted/ reset.

    Yes, the association is just used when deleting them. Nothing more.

    What you request is only possible with custom made objects, as you will need to hardcode such behaviour.

    Depending on your exact needs, you could create some scripts for it as well.

    The logic behind it is very simple.

    You can give every VW object a unique name. This name can be used to get a handle to the object.

    If you would create a script or an object, object A should remember the name of Object B so it can get the handle of it whenever required.

×
×
  • Create New...