Jump to content

wezelboy

Member
  • Posts

    125
  • Joined

  • Last visited

Posts posted by wezelboy

  1. In our office we were thinking it would be handy to have hybrid groups similar to hybrid symbols.

    Any time I want hybrid functionality I have to create a symbol, which for some things seems to be a waste.

    Although it is possible to get this functionality from creative class use, in practice it is a huge PITA.

  2. I believe that even a cursory study of the possible attributes and references will be enlightening to those, who believe that IFC-based BIM is pointless and that everything useful and relevant can be easily processed by engineers etc eyeballing "drawings".

    It helps if they actually look at the drawings.

  3. There is a difference between multi-threading and 64 bit processing. In general, you will not see much of a speed gain from 64 bit processing. The main advantage that a 64 bit application affords is being able to address more than 4GB of memory.

    Multi-threading is a different story. A well written multi-threaded application can really shine on the newer multi-cored workstations. However, threading adds significant overhead, is much more difficult to write, and can be a huge pain to debug.

    VW is multi-threaded, but in what way I'm not sure.

  4. It is a compiler directive that is common in programming languages. It is actually part of a series of compiler directives- $DEFINE, $IFDEF, $IFNDEF, and $ENDIF.

    $DEFINE [macro code] is used as either a boolean flag to the compiler or to define a macro.

    You put blocks of code between $IFDEF and $ENDIF directives. If the identifier has been defined to the compiler with a $DEFINE directive, then that code is compiled. Otherwise it is ignored.

    $IFNDEF is the same as $IFDEF except that the code is compiled if the identifier is not defined.

    $IFNDEF is most commonly used for "warding"- which is the basically the practice of enclosing a code library in an $IFNDEF directive and having a $DEFINE directive inside the code library. This insures that each code library is defined and compiled only once.

    $IFDEF is commonly used in "instrumentation"- which is a method of debugging without the use of an interactive debugger.

  5. All the free editors I know of are for Mac. Macs have the benefit of having a large body of free old school UNIX apps available, like Xemacs (or vi if you prefer).

    I personally try to use code libraries as much as I can and bring them into my scripts with the {$INCLUDE} compiler directive. I keep the code libraries open in a seperate textedit (yes, I am too lazy to install Xemacs) window so I can make quick edits to them if I need to.

    -P

    Oh... and while we are on the subject of vScript improvements... I wish we could chuck the pascal out the window in favor of perl.

    And I want a pony.

  6. I would like to select all of the window PIOs that have an overall width of 7'6".

    I go to the custom selection command in the Tool menu, choose "select only" and "create script". Then in the criteria selection dialogue, I choose "field value" and enter a value of 7'6".

    When I run the script, it barfs with an error of expecting right parentheses. Most likely it is the quotation marks in the dimension that is confusing the parser.

    DSelectAll; SelectObj(INSYMBOL & ('Window'.'OverallWidth'=7'6"));

    If I do 90" it still barfs, and if I stick Num2Str in like this:

    DSelectAll; SelectObj(INSYMBOL & ('Window'.'OverallWidth'= Num2Str(7'6")));

    It still barfs.

    If I just do 90 without feet and inch marks, the script runs without selecting anything.

    This there any way to do a quick custom selection like this?

    -P

  7. Has anyone else had a problem using a dynarray of char as a variable parameter in a user defined function?

    What I am seeing in my script is the contents of the array disappear as soon as the procedure returns. If I change the type of the variable parameters to STRING, it works just fine. Scoping the function inside the calling function doesn't help, and I don't think it is an ALLOCATE problem because the dynarrays hold values just fine inside the function.

    Here's the function followed by the function that is calling it FWIW... (Sorry about the lack of tabbing...)

    {************************************************************}

    FUNCTION LibHasIDLabel(theObj: HANDLE; VAR theRecordName, theIDLabel: DYNARRAY[] OF CHAR): BOOLEAN;

    VAR

    recHand: HANDLE;

    recIndex, fieldIndex: INTEGER;

    recName, fieldName: STRING;

    labelFound: BOOLEAN;

    BEGIN

    LibHasIDLabel := FALSE;

    labelFound := FALSE;

    recIndex := 1;

    WHILE ((recIndex <= NumRecords(theObj)) AND (NOT labelFound)) DO

    BEGIN

    recHand:= GetRecord(theObj, recIndex);

    recName:= GetName(recHand);

    fieldIndex := 1;

    WHILE ((fieldIndex <= NumFields(recHand)) AND (NOT labelFound)) DO

    BEGIN

    fieldName := GetFldName(recHand, fieldIndex);

    IF ((Pos('IDLabel', fieldName)) = 1) THEN

    BEGIN

    theRecordName := recName;

    theIDLabel := GetRField(theObj, recName, fieldName);

    LibHasIDLabel := TRUE;

    labelFound := TRUE;

    {DBGINFO}

    Message('IDLabel ', theIDLabel, ' found in record ', theRecordName);

    Wait(2);

    {\DBGINFO}

    END; {IF Pos}

    fieldIndex := fieldIndex + 1;

    END; {WHILE fieldIndex}

    recIndex := recIndex + 1;

    END; {WHILE recIndex}

    END; {Lib_HasIDLabel}

    {************************************************************}

    FUNCTION CopyOver(theDestPIO: HANDLE): BOOLEAN;

    VAR

    parent, newObj, tempGroup: HANDLE;

    destPIOType, srcPIORecName, destPIORecName, srcPIOIDLabel, destPIOIDLabel: DYNARRAY[] OF CHAR;

    index: INTEGER;

    BEGIN

    IF (GetType(theDestPIO) = OBJ_PIO) THEN

    BEGIN

    {Make sure the two plug-ins are of the same type}

    destPIOType := LibGetPIOType(theDestPIO);

    {DBGINFO}

    Message('Destination PIO of type ', destPIOType, ' picked');

    Wait(1);

    {\DBGINFO}

    IF (Pos(srcPIOType, destPIOType) = 1) THEN

    BEGIN

    {Copy the IDLabel of theDestPIO to the srcPIO so that it is retained}

    IF (LibHasIDLabel(theDestPIO, destPIORecName, destPIOIDLabel)) AND (LibHasIDLabel(srcPIO, srcPIORecName, srcPIOIDLabel)) THEN

    BEGIN

    SetRField(srcPIO, srcPIORecName, 'IDLabel', destPIOIDLabel);

    {DBGINFO}

    Message('IDLabel ', destPIOIDLabel, ' copied to source PIO Record ', srcPIORecName);

    Wait(3);

    {\DBGINFO}

    END; {IF LibHasIDLabel}

    {Strip the non PIO records from theDestPIO}

    index := 1;

    WHILE ( index < NumRecords(theDestPIO)) DO

    BEGIN

    {DBGINFO}

    Message('Deleting record ', index, ' from destPIO');

    Wait(1);

    {\DBGINFO}

    DelObject(GetRecord(theDestPIO, index));

    index := index + 1;

    END; {WHILE index}

    {Add any extra records that the srcPIO has}

    index := 1;

    WHILE ( index < NumRecords(srcPIO)) DO

    BEGIN

    {DBGINFO}

    Message('Copying record ', index, ' from sourcePIO');

    Wait(1);

    {\DBGINFO}

    LibCopyNewRec(srcPIO, theDestPIO, GetName(GetRecord(srcPIO, index)));

    index := index + 1;

    END; {WHILE index}

    {Copy the PIO Record}

    {DBGINFO}

    Message('Copying the PIO Record');

    Wait(1);

    {\DBGINFO}

    LibCopyExistRec(srcPIO, theDestPIO, destPIOType);

    {Reset the dest object so that the changes are reflected}

    ResetObject(theDestPIO);

    END; {IF Pos}

    END; {IF GetType}

    CopyOver := FALSE;

    END; {CopyOver}

  8. Eventually I'd like to put our drawings under a version control system like subversion. It would be awesome if Vectorworks had some integration with version control systems (like co/ci functionality from within VW, mergable files, and smart revision clouds).

    Maybe I should just put this in the wish list.

×
×
  • Create New...