SketchUcation Plugin Store

 

 

ComponentInstance name and Group name

ComponentInstance name and Group name

Postby njeremy2 » Thu Apr 26, 2012 3:39 pm

Hello, I'm new here and I'm from France.

I have a problem in Ruby development.

I need to retrieve 3 elements:
chose.typename == "ComponentInstance" --> Name field from component info
chose.typename == "Group" --> Name Field from group info
And the third one, Definition name from compononent info.

Someone can help me ? I hope you understand me :)

I put an image of my code to show you

njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby TIG » Thu Apr 26, 2012 3:48 pm

It doesn't work like that.
If you have 'compinst' as a ComponentInstance you need to get its definition thus
compdefn=compinst.definition
then the name of that
name=compdefn.name
Each separate definition has a name, and each of a definition's instances can name their own names too.

To find the definition of a Group use
groupdefn=group.entities.parent
TIG
User avatar
TIG
Global Moderator
 
Posts: 14006
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby njeremy2 » Thu Apr 26, 2012 4:23 pm

I'm a beginner, it's my first week in Ruby developement

I've just finish to read "Automatic_Sketchup.pdf" from http://www.autosketchup.com/ and it's really good !

Code: Select all
chose.typename == "ComponentInstance"
chose.typename == "Group"

The entire code already work, but I just want to add a third condition.

I don't really know how to use it.
Code: Select all
if chose.typename == "ComponentInstance" || chose.typename == "Group" || [b]groupdefn[/b]
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby njeremy2 » Thu Apr 26, 2012 4:25 pm

this is my code :

Code: Select all
   #Explode all components and groups
   def Explosion(entities)
      nb = 0
      componentOrGroup = true
      #Stop until there is no group ou component left
      while 1
         found = false
         if componentOrGroup == false
            break
         end
         entities.each do |chose|
            if chose.typename == "ComponentInstance" || chose.typename == "Group" || ????
               if chose.name[0] != 95   #We check if the first character is "_" from ASCII table, if it's right we explode the group or component
                  chose.explode
                  nb += 1
                  found = true
               end
            end
         end
         if found == false
            componentOrGroup = false
         end
      end
      return nb
   end
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby Dan Rathbun » Thu Apr 26, 2012 6:00 pm

Do not use typename, is VERY slow.

Use .is_a?()

ie:

if chose.is_a?(Sketchup::ComponentInstance) || chose.is_a?(Sketchup::Group)
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4091
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby thomthom » Thu Apr 26, 2012 7:22 pm

Yes - as Dan says never ever use .typename.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17673
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby TIG » Thu Apr 26, 2012 7:24 pm

There is NO || ????
You could try alternative tests: e.g. if it's an instance get the instance.definition.name etc

Also methods [def] should start with a lower-case letter...
:?
TIG
User avatar
TIG
Global Moderator
 
Posts: 14006
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby TIG » Thu Apr 26, 2012 7:30 pm

Let's put this another way... :?
What are you trying to do?
[In words, not 'code'...]
I deduce that it's to find if something is an instance and then check that instance.definition.name against a 'text' pattern ??

If so it is much easier than you are making it...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14006
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby njeremy2 » Thu Apr 26, 2012 8:36 pm

thx ! I'll try this tomorrow


Hmmm let me explain, it's little bit difficult for me to explain that in English

I want to create a plugin which count every components and groups in the design.
With this plugin, you can calculate the texture you need for a group or component (Tomorrow, I will take screenshot to show you my work (but it's in French...)

For example, I have a component called "Wood Table" (definition name) and you call it "Table 200x300"
My plugin will count how many tables I have on design and how much texture of Wood I apply on all tables.
If I don't the plugin calculate the texture (I hope you understand this sentence :) ), I have to put "_" (character n° 95 in ASCII TABLE) and the plugin ignore the Table. (ex: "Table 200x300 --> "_Table 200x300")
But in my case, it only work for the name of groups and component, but I want to add the case for component-name. How should I do ?


Thanks a lot to everyone ! ;)

Jeremy
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby TIG » Thu Apr 26, 2012 10:44 pm

Instead of iterating entities to get all instances and then find their definitions, why not iterate the definitions list to get their instances ?
TIG
User avatar
TIG
Global Moderator
 
Posts: 14006
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby njeremy2 » Thu Apr 26, 2012 11:18 pm

TIG wrote:Instead of iterating entities to get all instances and then find their definitions, why not iterate the definitions list to get their instances ?


I just beginning ruby for sketchup less than 7 days, I don't know anything... :(

I just modified the code from someone.
Tomorrow, I will show you exactly what i'm trying to do.
I don't have sketchup in that computer
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby thomthom » Thu Apr 26, 2012 11:33 pm

I wrote a summary about instances and definitions in SketchUp: http://www.thomthom.net/thoughts/2012/0 ... -sketchup/
Hope it might help.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom
Global Moderator
 
Posts: 17673
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: thomthom
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby njeremy2 » Fri Apr 27, 2012 7:47 am

thomthom wrote:I wrote a summary about instances and definitions in SketchUp: http://www.thomthom.net/thoughts/2012/0 ... -sketchup/
Hope it might help.



I already read it ;) thanks you !
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby njeremy2 » Fri Apr 27, 2012 8:35 am

My plugin :











My group has a name : "GroupWood"
2 same components : 1 with name "Bench1" and the 2nd without name.
The plugin will retrive all informations and put that in table in HTML webpage.
In component section, if the name of component is empty, the plugin retrive definition name. If it has a name, it takes the name.

If I put "_" before the name of the group or name of component, the plugin ignore the texture of them.
But if I put "_" before the definition name, it doesn't work. I would like to add this third condition my program.

Someone can help me ? :)

njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby TIG » Fri Apr 27, 2012 10:06 am

You are not making this easy by hiding your code from use and then expecting us to 'fix' it.
Here is how I would check some text [refernced as 'str'] to see it it starts with a '_'
str=~/^_/
If there's no match it returns 'nil' if there's a match you get 0.
So to test a 'name' against the pattern just use
if name=~/^_/
### do something
end

Test the group.name, instance.name and instance.definition.name in turn :?
TIG
User avatar
TIG
Global Moderator
 
Posts: 14006
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby njeremy2 » Fri Apr 27, 2012 1:16 pm

I'm not hiding anything, I just forgot to sent you! ^^
Code: Select all
=begin
author : njeremy2
# This software is provided as an example of using the Ruby interface
# to SketchUp.

# Permission to use, copy, modify, and distribute this software for
# any purpose and without fee is hereby granted, provided that the above
# copyright notice appear in all copies.

# THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
=end

Sketchup::require 'sketchup'

# Conversion pouces² vers m²
def p2m2(superficie)
   superficie/1550.0
end

#Conversion pouces3 vers m3
def p2m3(volume)
   volume/61023.7440947323
end

#Ajoute à la classe float une méthode permettant d'arrondir avec 2 chiffres après la virgule
class Float
   def round2
      i=((self*100).round.to_f)/100
      return i
   end
end

#Permet d'exporter dans un fichier html le nom et la quantité des Composants, Matières, Groupe (+volume). L'utilisateur peut choisir d'exporter les données qu'il souhaite
#L'utilisateur peut choisir d'ignorer certains composants ou groupes (comme les végétaux) en les préfixant d'un _
class Export
   #Initialisation
   def initialize
      UI.messagebox "Variables chargés 1"
      @model = Sketchup.active_model
      @entities = @model.entities
      @materials = @model.materials
      UI.messagebox "Variables chargés 2"
      
      
      
      
      
      
      
      @tabGroupes = []
      @tabMateriaux = []
      @tabComposants = []
      @nomFichier = @model.path
      @cheminScript= '/ATI/scripts/exportS.html'
      4.times do
         @nomFichier.chop!
      end
      @nomFichier += "_ExportS.html"
      input()
   end
   
   #Demande de renseignements à l'utilisateur
   def input
      prompts = ["Nom et chemin du fichier à exporter",
            "Composants",
            "Matières en m²",
            "Groupes"
            ]
            # "Volume des Groupes" supprimé du formulaire
      defs = ["#{@nomFichier}", "Oui", "Oui", "Oui", "Non"] # "non" supprimé pour volume des groupes
      list = ["", "Oui|Non", "Oui|Non", "Oui|Non"]      
      resultats = inputbox(prompts, defs, list, "Paramétrer l'export")
      @nomFichier = resultats[0].to_s
      @composants = resultats[1].to_s
      @matiere = resultats[2].to_s
      @groupe = resultats[3].to_s
      # @volume = resultats[4].to_s
   end
   
   #Exporte le nombre et le nom de chaque chose dans un fichier html défini par l'utilisateur
   def exporter
      listerElements()

      #Créer le fichier
      fichierExport = File.new("#{@nomFichier.to_s}", "w")
      
      #Ecrire les informations dedans
      #Formulaire html
      fichierExport.write "<html>"
         fichierExport.write "<form method=\"GET\" action=\""
         fichierExport.write @cheminScript.to_s
         fichierExport.write "\">"
         
         #Titre en haut a gauche de l'écran (titre du fichier de sauvegarde)
         fichierExport.write "<head>"
            fichierExport.write "Projet : <b>"+(@model.title).to_s+"</b><br />"
            fichierExport.write "<input type=\"hidden\" value=\"#{@model.title}\" name=\"nomModele\">"
         fichierExport.write "</head>"
         
         #Tableau
         fichierExport.write "<table border=\"1\" align=\"CENTER\">"
         
         #Affichage des têtes de colonnes
         fichierExport.write "<tr><td></td><td bgcolor=\"#99FF00\"><b>Nom</b></td><td bgcolor=\"#99FF00\"><b>Quantité ou surface</b></td></tr>"
         
         #Composants
         fichierExport.write "<tr><td bgcolor=\"#7CF8F8\"><b>Composants</b></td></tr>"
         i = 0
         @tabComposants.each do |composants|
            fichierExport.write "<tr><td></td>"
            fichierExport.write "<td>"
            if (composants[0].name == "")
               fichierExport.write (composants[0].definition.name).to_s
               fichierExport.write "<input type=\"hidden\" value=\"#{composants[0].definition.name}\" name=\"nomComposant#{i}\">"
               else
               fichierExport.write (composants[0].name).to_s
               fichierExport.write "<input type=\"hidden\" value=\"#{composants[0].name}\" name=\"nomComposant#{i}\">"
            end #endif
            fichierExport.write "</td>"
            # fichierExport.write "<td>" ## Ajout colonne début
            # fichierExport.write (composants[0].definition.name).to_s
            # fichierExport.write "<input type=\"hidden\" value=\"#{composants[0].definition.name}\" name=\"nomComposant#{i}\">"
            # fichierExport.write "</td>" ## Ajout d'une colonne fin
            fichierExport.write "<td>"
            fichierExport.write composants[1].to_s
            fichierExport.write "<input type=\"hidden\" value=\"#{composants[1].to_s}\" name=\"nbComposant#{i}\">"
            fichierExport.write "</td>"
            fichierExport.write "</tr>"
            i += 1
         end         
         
         #Groupes
         fichierExport.write "<tr><td bgcolor=\"#7CF8F8\"><b>Groupes</b></td></tr>"
         i = 0
         @tabGroupes.each do |groupe|
            fichierExport.write "<tr><td></td>"
            fichierExport.write "<td>"
            fichierExport.write (groupe[0].name).to_s
            fichierExport.write "<input type=\"hidden\" value=\"#{(groupe[0].name).to_s}\" name=\"nomGroupe#{i}\">"
            fichierExport.write "</td>"
            # fichierExport.write "<td>" ## Ajout colonne début
            
            
            
            # fichierExport.write "</td>" ## Ajout d'une colonne fin
            fichierExport.write "<td>"
            fichierExport.write groupe[1].to_s
            fichierExport.write "<input type=\"hidden\" value=\"#{groupe[1].to_s}\" name=\"nbGroupe#{i}\">"
            fichierExport.write "</td>"
            # #Si on gère les volumes et que le groupe n'est pas plat, on affiche son volume
            # if @volume == "Oui" && p2m3(groupe[0].volume) > 0
               # fichierExport.write "<td>"
               # fichierExport.write (p2m3(groupe[0].volume).round2).to_s
               # fichierExport.write " m3"
               # fichierExport.write "<input type=\"hidden\" value=\"#{(p2m3(groupe[0].volume).round2).to_s}\" name=\"volumeGroupe#{i}\">"
               # fichierExport.write "</td>"
            # end
            fichierExport.write "</tr>"
            i += 1
         end
         
         if @matiere == "Oui"
            #tout péter
            nb = eclater(@entities)
            
            #Calculer la surface des matériaux
            calculerSurfaceMateriau(@entities)
            
            #On purge le tableau des matériaux qui n'ont pas de surface (cas qui peut arriver s'il y a des végétaux et que l'utilisateur à préfixé le nom
            #avec un _
            @tabMateriaux = purgerTab(@tabMateriaux)            
            
            #tout reconstruire
            annuler(nb)
         end
         
         #Matières
         fichierExport.write "<tr><td bgcolor=\"#7CF8F8\"><b>Matières</b></td></tr>"
         i = 0
         @tabMateriaux.each do |matiere|
            fichierExport.write "<tr><td></td>"
            fichierExport.write "<td>"
            fichierExport.write (matiere[0].display_name).to_s
            fichierExport.write "<input type=\"hidden\" value=\"#{matiere[0].display_name.to_s}\" name=\"nomMat#{i}\">"
            fichierExport.write "</td>"
            # fichierExport.write "<td>" ## Ajout colonne début
            
            
            
            # fichierExport.write "</td>" ## Ajout d'une colonne fin
            fichierExport.write "<td>"
            fichierExport.write (matiere[1].round2).to_s
            fichierExport.write " m²"
            fichierExport.write "<input type=\"hidden\" value=\"#{matiere[1].round2.to_s}\" name=\"surfaceMat#{i}\">"
            fichierExport.write "</td>"
            fichierExport.write "</tr>"
            i += 1
         end   
      
         #Nombre de groupes, de composants et de matériau
         fichierExport.write "<input type=\"hidden\" value=\"#{@tabGroupes.length}\" name=\"nbGroupes\">"
         fichierExport.write "<input type=\"hidden\" value=\"#{@tabComposants.length}\" name=\"nbCompos\">"
         fichierExport.write "<input type=\"hidden\" value=\"#{@tabMateriaux.length}\" name=\"nbMats\">"
      
      #Fermeture des balises et bouton d'export au format csv
         fichierExport.write "</table>"
         fichierExport.write "<br />"
         fichierExport.write "<input type=\"submit\" value=\"Exporter au format csv\">"
         fichierExport.write "</form>"
      fichierExport.write "</html>"
      
      #Fermer le fichier
      fichierExport.close
      
      #Message pour l'utilisateur
      UI.openURL @nomFichier   
      
   end   
   
   #Crée un tableau avec tout les éléments comptés par type
   def listerElements   
      #On parcours tout les éléments et on les comptes
      @entities.each do |groupes|
         if groupes.typename == "Group" && @groupe == "Oui"
            compter(groupes, 1)
         elsif groupes.typename == "ComponentInstance" && @composants == "Oui"
            compter(groupes, 2)
         end
      end
      if @matiere == "Oui"
         #On purge les matériaux inutilisés
         @materials.purge_unused
         @materials.each do |materiau|
            compter(materiau, 3)
         end   
      end
   end
   
   #Regarde l'objet passé en paramètre et en tient le compte dans le tableau correspondant
   def compter(chose, type)
      #Init
      trouve = false
      
      #On récupère le tableau qu'on l'on va devoir traiter
      tab = @tabGroupes if type == 1
      tab = @tabComposants if type == 2
      tab = @tabMateriaux if type == 3
      #x représente le nombre d'occurences, si c'est un matériau on l'initialise à 0 car on contera la surface totale plus tard.
      #si c'est un groupe ou composant on l'initialise à 1 pour pouvoir compter
      if type > 2
         x = 0
      else
         x = 1
      end
      
      
      #On regarde si l'élément existe déja, si oui on incrémente la case du tableau qui compte, si non on ajoute une nouvelle case
      tab.each do |element|
         if chose.name == element[0].name
            element[1] += x
            trouve = true
         end
      end
      
      if trouve == false
         tab.push([chose, x])
      end
      
      #on rend le tableau que l'on à traité
      @tabGroupes = tab if type == 1
      @tabComposants = tab if type == 2
      @tabMateriaux = tab if type == 3
   end
   
   #Calcule la surface de chaque matériau
   def calculerSurfaceMateriau(entities)
      #Récupérer toutes les faces
      tabFaces = []
      entities.each do |element|
         if element.typename == "Face"
            tabFaces.push(element)
         end
      end
      
      #On regarde si la face possède un matériau, et si oui on calcule la surface
      tabFaces.each do |face|
         materiau = face.material
         materiauBack = face.back_material
         if materiau   || materiauBack         
            surface = p2m2(face.area)
            @tabMateriaux.each do |materiauxEnregistres|
               if materiau
                  if materiauxEnregistres[0].display_name == materiau.display_name
                     materiauxEnregistres[1] += surface
                  end
               end
               if materiauBack
                  if materiauxEnregistres[0].display_name == materiauBack.display_name
                     materiauxEnregistres[1] += surface
                  end
               end
            end
         end
      end
   end

   #Eclate tout les groupes et composants
   def eclater(entities)
      nb = 0
      composantOuGroupe = true
      #Tant qu'il reste un composant ou un groupe, on boucle en permanence pour tous les éclater. Dès qu'il n'y en a plus, on arrête      
      while 1
         trouve = false
         if composantOuGroupe == false
            break
         end
         # UI.messagebox "texte juste avant la boucle"
         entities.each do |chose|
            if chose.typename == "ComponentInstance" || chose.typename == "Group"
            # UI.messagebox "Texte juste apres qu'il vérifie si c'est un groupe ou si c'est un composant"
               if chose.name[0] != 95   #On vérifie que la premiere lettre ne soit pas un _ (on compare les codes ascii), [0] designe la position du caractere a rechercher
                  chose.explode
                  nb += 1
                  trouve = true
               end
            end
         end
         if trouve == false
            composantOuGroupe = false
         end
      end
      return nb
   end
   
   #Annule nb actions
   def annuler(nb)
      nb.times do
         Sketchup.undo
      end
   end
   
   #Recoit un tableau de tableau et le vide des éléments uniques
   def purgerTab(tab)
      tabReturn = []
      tab.each do |element|
         if element[1] != 0
            tabReturn.push(element)
         end
      end
      return tabReturn
   end
end
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby TIG » Fri Apr 27, 2012 2:12 pm

Something like
Code: Select all
if (chose.is_a?(Sketchup::ComponentInstance) && chose.definition.name=~/^_/ ) || (chose.name=~/^_/)
  chose.explode
  nb += 1
  trouve = true
end
:?
TIG
User avatar
TIG
Global Moderator
 
Posts: 14006
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby njeremy2 » Fri Apr 27, 2012 3:59 pm

it didn"t work ...

I will try something else. Another way

I practice in how I get the name of definition through a table, and then I will associate that with my code
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby TIG » Fri Apr 27, 2012 5:11 pm

If you have a reference to the instance you can easily get its definition, from which you can easily get the name of that.
I don't see where the difficulty is ?
You just need to add some extra tests to your code of instances... in more than one place - my example was how to get the initial name to use...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14006
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: ComponentInstance name and Group name

Postby njeremy2 » Fri Apr 27, 2012 9:36 pm

TIG wrote:If you have a reference to the instance you can easily get its definition, from which you can easily get the name of that.
I don't see where the difficulty is ?
You just need to add some extra tests to your code of instances... in more than one place - my example was how to get the initial name to use...



Yeah but i'm beginning ! so I have to learn what is exactly the difference between componentdefinition and componentinstance, it's hard for me !

Every document is written in english, I have to translate some words and then i have to understand each specific vocabulary of sketchup ... (in less than 1 week !)

I have to go easily on that !! :)

I will continue monday because I have no tools to continue at home

thx TIG! :thumb:
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

Re: ComponentInstance name and Group name

Postby njeremy2 » Mon Apr 30, 2012 9:36 am

Hi everyone !

I have found how to correct my code !! :)

It's was just an error of algorithm.

At first time I had this condition :
Code: Select all
chose.name[0] != 95


And I would like to have this :
Code: Select all
chose.name[0] != 95 || chose.definition.name[0] != 95


but it doesn't work ...

The solution is :
Code: Select all
chose.name[0] != 95 && chose.definition.name[0] != 95



As I said, I'm beginning ! :berserk:

Thanks to all! especially TIG
njeremy2
 
Posts: 58
Joined: Mon Apr 16, 2012 2:53 pm
Name: jeremy

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Not a Premium Member yet? Check out the great time-limited deal we are offering.

Ad Machine
Robot
 
Posts: 2012


Return to Developers' Forum

Who is online

Users browsing this forum: Bing [Bot], Google Bot, j0DiG0, KeithSWD and 4 guests