Jump to content

koenr

Member
  • Posts

    32
  • Joined

  • Last visited

Reputation

8 Neutral

Personal Information

  • Occupation
    Construction engineer
  • Homepage
    www.Concreetbv.be
  • Location
    Belgium

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello, I'm trying to set a recordfield of my .vso object. Normaly i just use vs.SetRField() but since this is a popup list i can't set the active value this way. Does anybody knows a workaround for this problem? Thanks in advance!
  2. The thing i was doing wrong was i tried to input only 1 value wich couldn't be a tuple. If i put an empty string as first label it works fine πŸ˜‰
  3. @twk Thank you so much!! I also tried with tuples but still got errors... Guess I still did somthing wrong then but your code works perfectly! πŸ˜„
  4. I found a workaround for those who also need this. In my python script after the creation of a class i whrote the following: vs.DoMenuTextByName("SetLabelConcreet", 0) def createclass(): ACTIVECLASS = vs.ActiveClass() vs.NameClass(self.name) if self.fillpattern == "EMPTY": vs.SetClFPat(self.name, 0) elif self.fillpattern == "SOLID": vs.SetClFPat(self.name, 1) elif self.fillpattern == "ARC": hatchindex = -1 * vs.Name2Index(self.hatchname) vs.SetClFPat(self.name, hatchindex) vs.SetClFillBack(self.name, self.fillcolor) vs.SetClFillFore(self.name, self.fillcolor) if self.penpattern == 0: vs.SetClLSN(self.name, 0) elif self.penpattern == 2: vs.SetClLSN(self.name, 2) elif type(self.penpattern) == str: index = -1 * vs.Name2Index(self.penpattern) if index != 0: vs.SetClLSN(self.name, index) else: vs.AlertInform( f"Lijnstijl `{self.penpattern}` ontbreekt in dit document.", "importeer dit van een ander document of maak zelf aan.", False, ) else: custWarning("Lijnstijl bestaat niet.") vs.SetClLW(self.name, self.pensize * 40) vs.SetClPenBack(self.name, self.pencolor) vs.SetClPenFore(self.name, self.pencolor) vs.SetCLOpacityN(self.name, self.fillopacity, self.pennopacity) vs.SetClUseTextStyle(self.name, self.usetextstyle) vs.SetClTextStyleRef(self.name, vs.Name2Index(self.textstyle)) _b = vs.SetClassBeginningMarker(self.name, *self.beginmarker) # type: ignore _b = vs.SetClassEndMarker(self.name, *self.endmarker) # type: ignore vs.SetClUseGraphic(self.name, self.usegraphics) vs.DoMenuTextByName("SetLabelConcreet", 0) vs.NameClass(ACTIVECLASS) I then made a custom comand object in vectorscript and added this to my work enviroment. Procedure SetLabel; VAR A1: Array[1..1] of String; B1: Boolean; H1: Handle; BEGIN A1[1]:='Concreet'; H1:=GetObject(ActiveClass); B1:=SetObjectTags(H1, A1); End; Run(SetLabel); This now runs everytime i run my script.
  5. Hello, I'm trying to write a script that adds a label to a vwx class but i can't seem to figure it out.. I tought an array in vectorscript was the same as a list in python? Can someone please help me out πŸ˜„ def SetTags(): # List of tags i want to add l = ["Concreet"] # Handle to the vwx-class i want to add the label to h = vs.GetObject('00. Algmeen') # Function for setting the label vs.SetObjectTags(h, l) SetTags() # Result -> Error: Invalid callback function parameter type. Parameter index= 1 name=arrTags # file "<string>", line 12, in <module> # file "<string>", line 9, in SetTags # file "<string>", line 1, in <module> This is what i have in vectorscript and this works but all my code is in python. Procedure Test; VAR A1: Array[1..1] of String; B1: Boolean; Begin BEGIN A1[1]:='Concreet'; B1:=SetObjectTags(GetObject('00. Algemeen'), A1); End; End; Run(Test);
  6. Hello, I have created a custom PointObject for SlabFoundations. (see picture) Everthing is working just fine but i was wondering if there is a special event where i can decide what to do when i draw a 2d shape over it and want to cut it out of the geometry. If this is possible please let me know and maybe a small example on how to go about it. Thanks in advance πŸ˜„ def main(): if event == kObjOnInitXProperties: setlayout() elif event == kResetEventID: vs.SetClass(objecthandle, klasse_object) set_by_class(objecthandle) if bovennet: vs.EnableParameter(objecthandle, "Type_BN", True) else: vs.EnableParameter(objecthandle, "Type_BN", False) if ondernet: vs.EnableParameter(objecthandle, "Type_ON", True) else: vs.EnableParameter(objecthandle, "Type_ON", False) if exclplaat: vs.EnableParameter(objecthandle, "Plaatdikte", True) else: vs.EnableParameter(objecthandle, "Plaatdikte", False) create_object() calc_opp() calc_vol()
  7. It would be very usefull to have an option to snap to the centre line off a walls core component. We draw structural plans and we always refer to the middle off the structural parts. Seems like a simple but realy usefull feature πŸ˜‰
  8. I would love to see a searchbar inside the datavisualisation tab. I think over the years that almost everthing got this feature but i use this a lot and have a lot off classes inside my document so it would be verry helpfull. ❀️
  9. Hello, I'm back with another question. I'm almost there but there is only 1 problem left. I select the opening and run this simple script but instead of naming the opening it names the wall it is in. This was just for testing what was going wrong but the idea is that i can read some values out off the wall and write those to a record attached to the opening.
  10. That was what i thought yes but it didn't seem to work when i ran my script it said that "vs.SetupDialogC" wasn't defined. Now that i manualy set SetupDialogC to 12256 it works perfectly. i noticed indeed like Raymond said. Now i put it in the setup event and it works like a charm. That's interesting! πŸ˜„
  11. @MullinRJ That number there β†’ 12255! That was the one i could not find! Thanks again for your help! πŸ˜„ I will look into that savedsettings function, it looks pretty good indeed πŸ˜‰
  12. Hello @MullinRJ, I think you missunderstood me but still thanks for your opinion. I'm pretty new to the dialog boxes but i begin to get the hang of it. I tried a lot of thing yesterday evening and i found a solution to my problem. To explain again what the problem was: i made a plugin that zooms to objects one by one and puts those in the midle of the screen. Than i must enter a specific value for that object in my dialogbox (wich appears in the middle of the screen aswell) Now my dialog opens at the topleft corner of my screen so i can see the object that is selected. In vectorscript there is such a thing as: BEGIN CASE item OF SetupDialogC: BEGIN SetLayoutDialogPosistion(dialog, x, y); END; 1: {OK} BEGIN ............ END ................ This constant value "SetupDialogC" doesn't work if you write your code in Python like i do. I needed the integer that would result in this event like "1 β†’ OK". Solution was: Get rid of that case and write all your preparation in the begining of the dialoghandler. Correct me if this is a wrong way of doing things but it seems to work. def DialogHandler(item, data): _b = vs.SetLayoutDialogPosition(dialog, 200, 150) if item == kselect: vint1 = 0 # p = vs.GetPt() # h = vs.PickObject(p) # vint1 = int(vs.GetDimText(h)) vs.SetEditInteger(dialog, kint1, vint1) if item == kOK: _b, rundialog.maatlijn = vs.GetEditInteger(dialog, kint1) return item
  13. Hey, @JBenghiat I want to set the deafult position of a dialog but i don't know in wich part of dialog handler i need to do this? I see a lot about the "kEventDialogPrep" but what item is this? Hope you can help me out here πŸ˜„
  14. Ow god.. Thanks a lot i found it! This is gonna help me so much! ❀️
  15. I realy can't find it anywhere @Pat Stanford. These are the only appendixes i can find and there is no table like yours above 😞 Do u have an url or can you send the offline version to my email?
Γ—
Γ—
  • Create New...